diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 80f3fca..0000000 --- a/.editorconfig +++ /dev/null @@ -1,189 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Ignore generated lock files for GitHub Agentic Workflows: -[*.lock.yml] -charset = unset -end_of_line = unset -indent_style = unset -indent_size = unset -trim_trailing_whitespace = unset -insert_final_newline = unset - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 24b327f..0000000 --- a/.gitattributes +++ /dev/null @@ -1,68 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation - -.github/workflows/*.lock.yml linguist-generated=true merge=ours diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 73cd687..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/every) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index 6d2d0c1..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/every) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 89a8e85..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '38 14 * * 1' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 83d50c4..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,821 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );" - fi - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send notification to Zulip if job fails: - - name: 'Send notification to Zulip in case of failure' - # Pin action to full length commit SHA - uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2 - if: failure() - with: - api-key: ${{ secrets.ZULIP_API_KEY }} - email: 'github-actions-bot@stdlib.zulipchat.com' - organization-url: 'https://stdlib.zulipchat.com' - to: 'workflows-standalone' - type: 'stream' - topic: ${{ github.event.repository.name }} - content: | - :cross_mark: **${{ github.workflow }}** workflow failed - - **Repository:** [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) - **Run:** [View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n +``` -```javascript -var every = require( '@stdlib/ndarray-base-every' ); +If no recognized module system is present, access bundle contents via the global scope: + +```html + ``` #### every( arrays ) @@ -138,10 +144,15 @@ The provided ndarray should be an object with the following properties: -```javascript -var bernoulli = require( '@stdlib/random-array-bernoulli' ); -var ndarray2array = require( '@stdlib/ndarray-base-to-array' ); -var every = require( '@stdlib/ndarray-base-every' ); +```html + + + + + + + + + ```
@@ -165,5361 +181,7 @@ console.log( out ); -* * * - -
- -## C APIs - - - -
- -Character codes for data types: - - - - - -- **x**: `bool` (boolean). -- **z**: `complex128` (double-precision floating-point complex number). -- **c**: `complex64` (single-precision floating-point complex number). -- **f**: `float32` (single-precision floating-point number). -- **d**: `float64` (double-precision floating-point number). -- **k**: `int16` (signed 16-bit integer). -- **i**: `int32` (signed 32-bit integer). -- **s**: `int8` (signed 8-bit integer). -- **t**: `uint16` (unsigned 16-bit integer). -- **u**: `uint32` (unsigned 32-bit integer). -- **b**: `uint8` (unsigned 8-bit integer). - - - -Function name suffix naming convention: - -```text -stdlib_ndarray_every__ -``` - -For example, - - - -```c -void stdlib_ndarray_every_d_x(...) {...} -``` - -is a function which accepts one double-precision floating-point input ndarray and one boolean output ndarray. - -Function name suffix naming convention for applying a predicate function: - -```text -stdlib_ndarray_every_by__[_as__] -``` - -For example, - - - -```c -void stdlib_ndarray_every_by_d_x(...) {...} -``` - -is a function which accepts one double-precision floating-point input ndarray and one boolean output ndarray. In other words, the suffix encodes the function type signature. - -To support callbacks whose input arguments are of a different data type than the input ndarray data type, the naming convention supports appending an `as` suffix. For example, - - - -```c -void stdlib_ndarray_every_by_f_x_as_d_x(...) {...} -``` - -is a function which accepts one single-precision floating-point input ndarray and one boolean output ndarray. However, the callback accepts double-precision floating-point numbers. Accordingly, the input values need to be cast using the following conversion sequence - - - -```c -#include - -// Convert each input array element to double-precision: -double in1 = (double)x[ i ]; - -// Evaluate the callback: -bool out = f( in1 ); -``` - -
- - - - - -
- -### Usage - -```c -#include "stdlib/ndarray/base/every.h" -``` - - - - - -#### stdlib_ndarray_every_b_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_b_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_b_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_c_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 16, 8 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_c_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_c_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_d_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 16, 8 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_d_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_d_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_f_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_f_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_f_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_i_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_i_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_i_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_k_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_k_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_k_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_s_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_s_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_s_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_t_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_t_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_t_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_u_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_u_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_u_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_x_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_x_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_x_x( struct ndarray *arrays[], void *data ); -``` - -#### stdlib_ndarray_every_z_x( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 32, 16 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_z_x( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_z_x( struct ndarray *arrays[], void *data ); -``` - - - - - -#### stdlib_ndarray_every_by_b_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const uint8_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(uint8_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_b_x_as_c_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex64_t x ) { - return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x_as_c_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x_as_c_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_b_x_as_d_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const double x ) { - return x == 0.0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x_as_d_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x_as_d_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_b_x_as_f_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const float x ) { - return x == 0.0f; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x_as_f_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x_as_f_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_b_x_as_i_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int32_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x_as_i_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x_as_i_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_b_x_as_k_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int16_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x_as_k_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int16_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x_as_k_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_b_x_as_t_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const uint16_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x_as_t_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(uint16_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x_as_t_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_b_x_as_u_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const uint32_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x_as_u_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(uint32_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x_as_u_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_b_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_b_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_b_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_c_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 16, 8 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex64_t x ) { - return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_c_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_c_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_c_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 16, 8 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_c_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_c_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_d_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 16, 8 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const double x ) { - return x == 0.0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_d_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_d_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_d_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 16, 8 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_d_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_d_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_f_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const float x ) { - return x == 0.0f; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_f_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_f_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_f_x_as_c_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex64_t x ) { - return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_f_x_as_c_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_f_x_as_c_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_f_x_as_d_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const double x ) { - return x == 0.0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_f_x_as_d_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_f_x_as_d_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_f_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_f_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_f_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_i_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int32_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_i_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_i_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_i_x_as_d_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const double x ) { - return x == 0.0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_i_x_as_d_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_i_x_as_d_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_i_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_i_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_i_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_k_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int16_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_k_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int16_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_k_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_k_x_as_c_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex64_t x ) { - return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_k_x_as_c_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_k_x_as_c_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_k_x_as_d_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const double x ) { - return x == 0.0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_k_x_as_d_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_k_x_as_d_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_k_x_as_f_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const float x ) { - return x == 0.0f; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_k_x_as_f_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_k_x_as_f_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_k_x_as_i_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int32_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_k_x_as_i_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_k_x_as_i_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_k_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_k_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_k_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_s_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int8_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_s_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int8_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_s_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_s_x_as_c_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex64_t x ) { - return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_s_x_as_c_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_s_x_as_c_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_s_x_as_d_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const double x ) { - return x == 0.0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_s_x_as_d_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_s_x_as_d_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_s_x_as_f_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const float x ) { - return x == 0.0f; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_s_x_as_f_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_s_x_as_f_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_s_x_as_i_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int32_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_s_x_as_i_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_s_x_as_i_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_s_x_as_k_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int16_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_s_x_as_k_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int16_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_s_x_as_k_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_s_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_s_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_s_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_t_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const uint16_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_t_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(uint16_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_t_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_t_x_as_c_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex64_t x ) { - return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_t_x_as_c_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex64_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_t_x_as_c_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_t_x_as_d_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const double x ) { - return x == 0.0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_t_x_as_d_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_t_x_as_d_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_t_x_as_f_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const float x ) { - return x == 0.0f; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_t_x_as_f_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(float)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_t_x_as_f_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_t_x_as_i_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const int32_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_t_x_as_i_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(int32_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_t_x_as_i_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_t_x_as_u_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const uint32_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_t_x_as_u_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(uint32_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_t_x_as_u_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_t_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 4, 2 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_t_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_t_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_u_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const uint32_t x ) { - return x == 0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_u_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(uint32_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_u_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_u_x_as_d_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const double x ) { - return x == 0.0; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_u_x_as_d_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(double)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_u_x_as_d_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_u_x_as_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 8, 4 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_u_x_as_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_u_x_as_z_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_x_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 2, 1 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const bool x ) { - return x; -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_x_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(bool)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_x_x( struct ndarray *arrays[], void *fcn ); -``` - -#### stdlib_ndarray_every_by_z_x( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { 2, 2 }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { 32, 16 }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_z_x( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)(stdlib_complex128_t)` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_z_x( struct ndarray *arrays[], void *fcn ); -``` - - - - - - - - - -
- - - - - -
- -
- - - - - -* * * - -
- -### Examples - -```c -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -static bool fcn( const uint8_t x ) { - return ( x != 0 ); -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - uint8_t xbuf[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; - uint8_t ybuf[] = { 0 }; - - // Define the number of input array dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 4, 2, 1 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_by_b_x( arrays, (void *)fcn ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} -``` - -
- - - -
- diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.10d_blocked_columnmajor.js b/benchmark/benchmark.10d_blocked_columnmajor.js deleted file mode 100644 index 47f4112..0000000 --- a/benchmark/benchmark.10d_blocked_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/10d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/10.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 9 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_blocked_rowmajor.js b/benchmark/benchmark.10d_blocked_rowmajor.js deleted file mode 100644 index 7fefd00..0000000 --- a/benchmark/benchmark.10d_blocked_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/10d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/10.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 9 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_columnmajor.js b/benchmark/benchmark.10d_columnmajor.js deleted file mode 100644 index fe27254..0000000 --- a/benchmark/benchmark.10d_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/10d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/10.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 9 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.10d_rowmajor.js b/benchmark/benchmark.10d_rowmajor.js deleted file mode 100644 index 1c750a6..0000000 --- a/benchmark/benchmark.10d_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/10d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/10.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 9 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.11d_columnmajor.js b/benchmark/benchmark.11d_columnmajor.js deleted file mode 100644 index 51fdc44..0000000 --- a/benchmark/benchmark.11d_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/nd.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/11.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 10 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.11d_rowmajor.js b/benchmark/benchmark.11d_rowmajor.js deleted file mode 100644 index 8217bb8..0000000 --- a/benchmark/benchmark.11d_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/nd.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/11.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 10 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.1d_columnmajor.js b/benchmark/benchmark.1d_columnmajor.js deleted file mode 100644 index 807e357..0000000 --- a/benchmark/benchmark.1d_columnmajor.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( [ x ] ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.1d_rowmajor.js b/benchmark/benchmark.1d_rowmajor.js deleted file mode 100644 index 0d1ca36..0000000 --- a/benchmark/benchmark.1d_rowmajor.js +++ /dev/null @@ -1,125 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( [ x ] ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_blocked_columnmajor.js b/benchmark/benchmark.2d_blocked_columnmajor.js deleted file mode 100644 index 0947d28..0000000 --- a/benchmark/benchmark.2d_blocked_columnmajor.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/2d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_blocked_rowmajor.js b/benchmark/benchmark.2d_blocked_rowmajor.js deleted file mode 100644 index dab0fc7..0000000 --- a/benchmark/benchmark.2d_blocked_rowmajor.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/2d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_columnmajor.js b/benchmark/benchmark.2d_columnmajor.js deleted file mode 100644 index 5f26827..0000000 --- a/benchmark/benchmark.2d_columnmajor.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/2d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_rowmajor.js b/benchmark/benchmark.2d_rowmajor.js deleted file mode 100644 index b59104f..0000000 --- a/benchmark/benchmark.2d_rowmajor.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/2d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_rowmajor_accessors.js b/benchmark/benchmark.2d_rowmajor_accessors.js deleted file mode 100644 index a0dc927..0000000 --- a/benchmark/benchmark.2d_rowmajor_accessors.js +++ /dev/null @@ -1,163 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/2d_accessors.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Returns an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @returns {*} element -*/ -function get( buf, idx ) { - return buf[ idx ]; -} - -/** -* Sets an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @param {*} value - value to set -*/ -function set( buf, idx, value ) { - buf[ idx ] = value; -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order, - 'accessorProtocol': true, - 'accessors': [ get, set ] - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.2d_rowmajor_accessors_complex.js b/benchmark/benchmark.2d_rowmajor_accessors_complex.js deleted file mode 100644 index bb0884d..0000000 --- a/benchmark/benchmark.2d_rowmajor_accessors_complex.js +++ /dev/null @@ -1,163 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var ctors = require( '@stdlib/array-typed-complex-ctors' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/2d_accessors.js' ); - - -// VARIABLES // - -var types = [ 'complex64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Returns an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @returns {*} element -*/ -function get( buf, idx ) { - return buf.get( idx ); -} - -/** -* Sets an array data buffer element. -* -* @private -* @param {Collection} buf - data buffer -* @param {NonNegativeInteger} idx - element index -* @param {*} value - value to set -*/ -function set( buf, idx, value ) { - buf.set( value, idx ); -} - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var xbuf; - var x; - - xbuf = discreteUniform( len*2, 1, 100 ); - x = { - 'dtype': xtype, - 'data': new ( ctors( xtype ) )( xbuf.buffer ), - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order, - 'accessorProtocol': true, - 'accessors': [ get, set ] - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 5; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( sqrt( len ) ); - sh = [ len, len ]; - len *= len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::accessors:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_blocked_columnmajor.js b/benchmark/benchmark.3d_blocked_columnmajor.js deleted file mode 100644 index f8f0468..0000000 --- a/benchmark/benchmark.3d_blocked_columnmajor.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/3d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_blocked_rowmajor.js b/benchmark/benchmark.3d_blocked_rowmajor.js deleted file mode 100644 index c48c918..0000000 --- a/benchmark/benchmark.3d_blocked_rowmajor.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/3d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_columnmajor.js b/benchmark/benchmark.3d_columnmajor.js deleted file mode 100644 index 08236f5..0000000 --- a/benchmark/benchmark.3d_columnmajor.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/3d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.3d_rowmajor.js b/benchmark/benchmark.3d_rowmajor.js deleted file mode 100644 index 1438da2..0000000 --- a/benchmark/benchmark.3d_rowmajor.js +++ /dev/null @@ -1,137 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/3d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( cbrt( len ) ); - sh = [ len, len, len ]; - len *= len * len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_blocked_columnmajor.js b/benchmark/benchmark.4d_blocked_columnmajor.js deleted file mode 100644 index 68a3623..0000000 --- a/benchmark/benchmark.4d_blocked_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/4d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/4.0 ) ); - sh = [ len, len, len, len ]; - len *= len * len * len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_blocked_rowmajor.js b/benchmark/benchmark.4d_blocked_rowmajor.js deleted file mode 100644 index 6aa939f..0000000 --- a/benchmark/benchmark.4d_blocked_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/4d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/4.0 ) ); - sh = [ len, len, len, len ]; - len *= len * len * len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_columnmajor.js b/benchmark/benchmark.4d_columnmajor.js deleted file mode 100644 index fb42ad0..0000000 --- a/benchmark/benchmark.4d_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/4d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/4.0 ) ); - sh = [ len, len, len, len ]; - len *= len * len * len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.4d_rowmajor.js b/benchmark/benchmark.4d_rowmajor.js deleted file mode 100644 index 4a05b75..0000000 --- a/benchmark/benchmark.4d_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/4d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/4.0 ) ); - sh = [ len, len, len, len ]; - len *= len * len * len; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_blocked_columnmajor.js b/benchmark/benchmark.5d_blocked_columnmajor.js deleted file mode 100644 index 9e1314f..0000000 --- a/benchmark/benchmark.5d_blocked_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/5d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/5.0 ) ); - sh = [ len, len, len, len, len ]; - len *= pow( len, 4 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_blocked_rowmajor.js b/benchmark/benchmark.5d_blocked_rowmajor.js deleted file mode 100644 index f86f46c..0000000 --- a/benchmark/benchmark.5d_blocked_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/5d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/5.0 ) ); - sh = [ len, len, len, len, len ]; - len *= pow( len, 4 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_columnmajor.js b/benchmark/benchmark.5d_columnmajor.js deleted file mode 100644 index 9892e2c..0000000 --- a/benchmark/benchmark.5d_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/5d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/5.0 ) ); - sh = [ len, len, len, len, len ]; - len *= pow( len, 4 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.5d_rowmajor.js b/benchmark/benchmark.5d_rowmajor.js deleted file mode 100644 index ba28f21..0000000 --- a/benchmark/benchmark.5d_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/5d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/5.0 ) ); - sh = [ len, len, len, len, len ]; - len *= pow( len, 4 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_blocked_columnmajor.js b/benchmark/benchmark.6d_blocked_columnmajor.js deleted file mode 100644 index 4d8ac44..0000000 --- a/benchmark/benchmark.6d_blocked_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/6d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/6.0 ) ); - sh = [ len, len, len, len, len, len ]; - len *= pow( len, 5 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_blocked_rowmajor.js b/benchmark/benchmark.6d_blocked_rowmajor.js deleted file mode 100644 index cd4d840..0000000 --- a/benchmark/benchmark.6d_blocked_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/6d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/6.0 ) ); - sh = [ len, len, len, len, len, len ]; - len *= pow( len, 5 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_columnmajor.js b/benchmark/benchmark.6d_columnmajor.js deleted file mode 100644 index 4250d72..0000000 --- a/benchmark/benchmark.6d_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/6d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/6.0 ) ); - sh = [ len, len, len, len, len, len ]; - len *= pow( len, 5 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.6d_rowmajor.js b/benchmark/benchmark.6d_rowmajor.js deleted file mode 100644 index 6e70436..0000000 --- a/benchmark/benchmark.6d_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/6d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/6.0 ) ); - sh = [ len, len, len, len, len, len ]; - len *= pow( len, 5 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_blocked_columnmajor.js b/benchmark/benchmark.7d_blocked_columnmajor.js deleted file mode 100644 index b3b8ccd..0000000 --- a/benchmark/benchmark.7d_blocked_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/7d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/7.0 ) ); - sh = [ len, len, len, len, len, len, len ]; - len *= pow( len, 6 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_blocked_rowmajor.js b/benchmark/benchmark.7d_blocked_rowmajor.js deleted file mode 100644 index 403140d..0000000 --- a/benchmark/benchmark.7d_blocked_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/7d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/7.0 ) ); - sh = [ len, len, len, len, len, len, len ]; - len *= pow( len, 6 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_columnmajor.js b/benchmark/benchmark.7d_columnmajor.js deleted file mode 100644 index a2cda94..0000000 --- a/benchmark/benchmark.7d_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/7d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/7.0 ) ); - sh = [ len, len, len, len, len, len, len ]; - len *= pow( len, 6 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.7d_rowmajor.js b/benchmark/benchmark.7d_rowmajor.js deleted file mode 100644 index 203d441..0000000 --- a/benchmark/benchmark.7d_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/7d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/7.0 ) ); - sh = [ len, len, len, len, len, len, len ]; - len *= pow( len, 6 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_blocked_columnmajor.js b/benchmark/benchmark.8d_blocked_columnmajor.js deleted file mode 100644 index ef09adc..0000000 --- a/benchmark/benchmark.8d_blocked_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/8d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/8.0 ) ); - sh = [ len, len, len, len, len, len, len, len ]; - len *= pow( len, 7 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_blocked_rowmajor.js b/benchmark/benchmark.8d_blocked_rowmajor.js deleted file mode 100644 index ef09adc..0000000 --- a/benchmark/benchmark.8d_blocked_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/8d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/8.0 ) ); - sh = [ len, len, len, len, len, len, len, len ]; - len *= pow( len, 7 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_columnmajor.js b/benchmark/benchmark.8d_columnmajor.js deleted file mode 100644 index d891533..0000000 --- a/benchmark/benchmark.8d_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/8d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/8.0 ) ); - sh = [ len, len, len, len, len, len, len, len ]; - len *= pow( len, 7 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.8d_rowmajor.js b/benchmark/benchmark.8d_rowmajor.js deleted file mode 100644 index c976ed4..0000000 --- a/benchmark/benchmark.8d_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/8d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/8.0 ) ); - sh = [ len, len, len, len, len, len, len, len ]; - len *= pow( len, 7 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_blocked_columnmajor.js b/benchmark/benchmark.9d_blocked_columnmajor.js deleted file mode 100644 index e793f79..0000000 --- a/benchmark/benchmark.9d_blocked_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/9d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/9.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 8 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_blocked_rowmajor.js b/benchmark/benchmark.9d_blocked_rowmajor.js deleted file mode 100644 index 06ab0b8..0000000 --- a/benchmark/benchmark.9d_blocked_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/9d_blocked.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/9.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 8 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s::blocked:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_columnmajor.js b/benchmark/benchmark.9d_columnmajor.js deleted file mode 100644 index 7a952b4..0000000 --- a/benchmark/benchmark.9d_columnmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/9d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'column-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/9.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 8 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/benchmark/benchmark.9d_rowmajor.js b/benchmark/benchmark.9d_rowmajor.js deleted file mode 100644 index 0ae883f..0000000 --- a/benchmark/benchmark.9d_rowmajor.js +++ /dev/null @@ -1,136 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2025 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive; -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var format = require( '@stdlib/string-format' ); -var pkg = require( './../package.json' ).name; -var every = require( './../lib/9d.js' ); - - -// VARIABLES // - -var types = [ 'float64' ]; -var order = 'row-major'; - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - ndarray length -* @param {NonNegativeIntegerArray} shape - ndarray shape -* @param {string} xtype - ndarray data type -* @returns {Function} benchmark function -*/ -function createBenchmark( len, shape, xtype ) { - var x; - - x = discreteUniform( len, 1, 100, { - 'dtype': xtype - }); - x = { - 'dtype': xtype, - 'data': x, - 'shape': shape, - 'strides': shape2strides( shape, order ), - 'offset': 0, - 'order': order - }; - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = every( x ); - if ( typeof out !== 'boolean' ) { - b.fail( 'should return a boolean' ); - } - } - b.toc(); - if ( !isBoolean( out ) ) { - b.fail( 'should return a boolean' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var sh; - var t1; - var f; - var i; - var j; - - min = 1; // 10^min - max = 6; // 10^max - - for ( j = 0; j < types.length; j++ ) { - t1 = types[ j ]; - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - - sh = [ len/2, 2, 1, 1, 1, 1, 1, 1, 1 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - sh = [ 1, 1, 1, 1, 1, 1, 1, 2, len/2 ]; - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - - len = floor( pow( len, 1.0/9.0 ) ); - sh = [ len, len, len, len, len, len, len, len, len ]; - len *= pow( len, 8 ); - f = createBenchmark( len, sh, t1 ); - bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s', pkg, sh.length, len, sh.join(','), order, t1 ), f ); - } - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 01fb2ff..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/every" -%% click B href "https://github.com/stdlib-js/ndarray-base-every/tree/main" -%% click C href "https://github.com/stdlib-js/ndarray-base-every/tree/production" -%% click D href "https://github.com/stdlib-js/ndarray-base-every/tree/esm" -%% click E href "https://github.com/stdlib-js/ndarray-base-every/tree/deno" -%% click F href "https://github.com/stdlib-js/ndarray-base-every/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/every -[production-url]: https://github.com/stdlib-js/ndarray-base-every/tree/production -[deno-url]: https://github.com/stdlib-js/ndarray-base-every/tree/deno -[deno-readme]: https://github.com/stdlib-js/ndarray-base-every/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/ndarray-base-every/tree/umd -[umd-readme]: https://github.com/stdlib-js/ndarray-base-every/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/ndarray-base-every/tree/esm -[esm-readme]: https://github.com/stdlib-js/ndarray-base-every/blob/esm/README.md \ No newline at end of file diff --git a/browser.js b/browser.js new file mode 100644 index 0000000..c6f0c2e --- /dev/null +++ b/browser.js @@ -0,0 +1,3 @@ +// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +var r,t;r=this,t=function(){"use strict";var r=8,t=16,e=1,n="function"==typeof Object.defineProperty?Object.defineProperty:null,o=Object.defineProperty;function i(r){return"number"==typeof r}function a(r){var t,e="";for(t=0;t0&&(e-=1),n=r.toExponential(e)):n=r.toPrecision(t.precision),t.alternate||(n=y.call(n,E,"$1e"),n=y.call(n,b,"e"),n=y.call(n,w,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return n=y.call(n,g,"e+0$1"),n=y.call(n,m,"e-0$1"),t.alternate&&(n=y.call(n,v,"$1."),n=y.call(n,d,"$1.e")),r>=0&&t.sign&&(n=t.sign+n),n=t.specifier===p.call(t.specifier)?p.call(n):c.call(n)}function T(r){var t,e="";for(t=0;t127)throw new Error("invalid character code. Value: "+n.arg);n.arg=A(a)?String(n.arg):x(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(t||(n.precision=6),h=parseFloat(n.arg),!isFinite(h)){if(!i(n.arg))throw new Error("invalid floating-point number. Value: "+u);h=n.arg,n.padZeros=!1}n.arg=_(h,n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=f(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(y=n.arg,g=n.width,m=n.padRight,v=void 0,(v=g-y.length)<0?y:y=m?y+T(v):T(v)+y)),u+=n.arg||"",s+=1}return u}var F=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function L(r){var t={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(t.precision="1"),t}function O(r){var t,e,n,o;for(e=[],o=0,n=F.exec(r);n;)(t=r.slice(o,F.lastIndex-n[0].length)).length&&e.push(t),"%"===n[6]?e.push("%"):e.push(L(n)),o=F.lastIndex,n=F.exec(r);return(t=r.slice(o)).length&&e.push(t),e}function I(r){var t,e;if("string"!=typeof r)throw new TypeError(I("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[O(r)],e=1;e0?i+=a*(r[f]-1):a<0&&(o+=a*(r[f]-1))}return[o,i]}Y(W,"assign",(function(r,t,e,n){var o,i,a,f,u;for(o=r.length,i=e,a=e,u=0;u0?a+=f*(r[u]-1):f<0&&(i+=f*(r[u]-1))}return n[0]=i,n[1]=a,n}));var Z="function";function $(r){return typeof r.get===Z&&typeof r.set===Z}var G={complex128:function(r,t){return r.get(t)},complex64:function(r,t){return r.get(t)},default:function(r,t){return r.get(t)}};function K(r){var t=G[r];return"function"==typeof t?t:G.default}var X={complex128:function(r,t,e){r.set(e,t)},complex64:function(r,t,e){r.set(e,t)},default:function(r,t,e){r.set(e,t)}};function z(r){var t=X[r];return"function"==typeof t?t:X.default}var H={float64:function(r,t){return r[t]},float32:function(r,t){return r[t]},int32:function(r,t){return r[t]},int16:function(r,t){return r[t]},int8:function(r,t){return r[t]},uint32:function(r,t){return r[t]},uint16:function(r,t){return r[t]},uint8:function(r,t){return r[t]},uint8c:function(r,t){return r[t]},generic:function(r,t){return r[t]},default:function(r,t){return r[t]}};function J(r){var t=H[r];return"function"==typeof t?t:H.default}var D={float64:function(r,t,e){r[t]=e},float32:function(r,t,e){r[t]=e},int32:function(r,t,e){r[t]=e},int16:function(r,t,e){r[t]=e},int8:function(r,t,e){r[t]=e},uint32:function(r,t,e){r[t]=e},uint16:function(r,t,e){r[t]=e},uint8:function(r,t,e){r[t]=e},uint8c:function(r,t,e){r[t]=e},generic:function(r,t,e){r[t]=e},default:function(r,t,e){r[t]=e}};function q(r){var t=D[r];return"function"==typeof t?t:D.default}function Q(r){var t,e,n;if(0===(t=r.length))return 0;for(e=1,n=0;n=0;o--)e[o]=n,n*=r[o];return e}(r)}Y(pr,"isPrimitive",tr),Y(pr,"isObject",cr),Y(gr,"assign",(function(r,t,e){return yr(t)?function(r,t){var e,n;for(e=1,n=0;n=0;n--)t[n]=e,e*=r[n];return t}(r,e)}));var mr="row-major";function vr(r,t){var e,n,o;return"object"!=typeof(o=r.strides)||null===o?0===(n=r.shape).length?[0]:(tr(e=r.order)||(e=mr),gr(n,e)):t?rr(o):o}function dr(r){return"number"==typeof r}var wr=Number,br=wr.prototype.toString,Er=nr();function _r(r){return"object"==typeof r&&(r instanceof wr||(Er?function(r){try{return br.call(r),!0}catch(r){return!1}}(r):"[object Number]"===sr(r)))}function Tr(r){return dr(r)||_r(r)}function xr(r){var t,e,n;return dr(n=r.offset)?n:0===(e=r.shape).length||"object"!=typeof(t=r.strides)||null===t?0:function(r,t){var e,n,o;for(n=r.length,e=0,o=0;oo&&(n=!1),!n&&!t)return 0;o=i}return n&&t?3:n?1:2}Y(Tr,"isPrimitive",dr),Y(Tr,"isObject",_r);var jr="row-major",Sr="column-major";function Fr(r){var t,e;return tr(e=r.order)?e:"object"!=typeof(t=r.strides)||null===t||1===(e=Ar(t))||3===e?jr:2===e?Sr:0===r.shape.length?jr:null}function Lr(r){var t,e,n,o;return t=function(r){return r.data}(r),n=function(r,t){var e=r.shape;return t?rr(e):e}(r,!0),o=function(r){return r.dtype}(r),e=$(t),{ref:r,dtype:o,data:t,length:Q(n),shape:n,strides:vr(r,!0),offset:xr(r),order:Fr(r),accessorProtocol:e,accessors:e?[K(o),z(o)]:[J(o),q(o)]}}var Or=16;function Ir(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Or}var kr=8;function Br(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===kr}var Rr,Pr="function"==typeof Float64Array,Mr="function"==typeof Float64Array?Float64Array:null,Cr="function"==typeof Float64Array?Float64Array:void 0;Rr=function(){var r,t,e;if("function"!=typeof Mr)return!1;try{t=new Mr([1,3.14,-3.14,NaN]),e=t,r=(Pr&&e instanceof Float64Array||"[object Float64Array]"===sr(e))&&1===t[0]&&3.14===t[1]&&-3.14===t[2]&&t[3]!=t[3]}catch(t){r=!1}return r}()?Cr:function(){throw new Error("not implemented")};var Nr=Rr;function Ur(r,t){return new Nr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}var Yr,Wr="function"==typeof Float32Array,Zr=Number.POSITIVE_INFINITY,$r="function"==typeof Float32Array?Float32Array:null,Gr="function"==typeof Float32Array?Float32Array:void 0;Yr=function(){var r,t,e;if("function"!=typeof $r)return!1;try{t=new $r([1,3.14,-3.14,5e40]),e=t,r=(Wr&&e instanceof Float32Array||"[object Float32Array]"===sr(e))&&1===t[0]&&3.140000104904175===t[1]&&-3.140000104904175===t[2]&&t[3]===Zr}catch(t){r=!1}return r}()?Gr:function(){throw new Error("not implemented")};var Kr=Yr;function Xr(r,t){return new Kr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}var zr,Hr="function"==typeof Uint8Array,Jr="function"==typeof Uint8Array?Uint8Array:null,Dr="function"==typeof Uint8Array?Uint8Array:void 0;zr=function(){var r,t,e;if("function"!=typeof Jr)return!1;try{t=new Jr(t=[1,3.14,-3.14,256,257]),e=t,r=(Hr&&e instanceof Uint8Array||"[object Uint8Array]"===sr(e))&&1===t[0]&&3===t[1]&&253===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?Dr:function(){throw new Error("not implemented")};var qr=zr,Qr=Array.isArray?Array.isArray:function(r){return"[object Array]"===sr(r)};function rt(r){if("function"!=typeof r)throw new TypeError(I("invalid argument. Must provide a function. Value: `%s`.",r));return function(t){var e,n;if(!Qr(t))return!1;if(0===(e=t.length))return!1;for(n=0;nCt&&Ut(r)}function Wt(r){return dr(r)&&Yt(r)}function Zt(r){return _r(r)&&Yt(r.valueOf())}function $t(r){return Wt(r)||Zt(r)}function Gt(r){return Wt(r)&&r>=0}function Kt(r){return Zt(r)&&r.valueOf()>=0}function Xt(r){return Gt(r)||Kt(r)}Y($t,"isPrimitive",Wt),Y($t,"isObject",Zt),Y(Xt,"isPrimitive",Gt),Y(Xt,"isObject",Kt);var zt=4294967295;function Ht(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&Ut(r.length)&&r.length>=0&&r.length<=zt}var Jt=9007199254740991;function Dt(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&Ut(r.length)&&r.length>=0&&r.length<=Jt}var qt="function"==typeof ArrayBuffer;function Qt(r){return qt&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===sr(r)}function re(r){return"object"==typeof r&&null!==r&&!Qr(r)}var te=rt(pr.isPrimitive),ee=rt(pr.isObject),ne=rt(pr);Y(ne,"primitives",te),Y(ne,"objects",ee);var oe=/./;function ie(r){return"boolean"==typeof r}var ae=Boolean,fe=Boolean.prototype.toString,ue=nr();function se(r){return"object"==typeof r&&(r instanceof ae||(ue?function(r){try{return fe.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===sr(r)))}function le(r){return ie(r)||se(r)}Y(le,"isPrimitive",ie),Y(le,"isObject",se);var he="object"==typeof self?self:null,ce="object"==typeof window?window:null,pe="object"==typeof globalThis?globalThis:null,ye=function(r){if(arguments.length){if(!ie(r))throw new TypeError(I("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(pe)return pe;if(he)return he;if(ce)return ce;throw new Error("unexpected error. Unable to resolve global object.")}(),ge=ye.document&&ye.document.childNodes,me=Int8Array,ve="function"==typeof oe||"object"==typeof me||"function"==typeof ge?function(r){return it(r).toLowerCase()}:function(r){var t;return null===r?"null":"object"==(t=typeof r)?it(r).toLowerCase():t};function de(r){return"function"===ve(r)}function we(r,t,e){U(r,t,{configurable:!1,enumerable:!0,writable:!1,value:e})}function be(r,t){if(!(this instanceof be))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!dr(r))throw new TypeError(I("invalid argument. Real component must be a number. Value: `%s`.",r));if(!dr(t))throw new TypeError(I("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return we(this,"re",r),we(this,"im",t),this}Y(be,"name","Complex128"),Y(be,"BYTES_PER_ELEMENT",8),Y(be.prototype,"BYTES_PER_ELEMENT",8),Y(be.prototype,"byteLength",16),Y(be.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),Y(be.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Ee="function"==typeof Math.fround?Math.fround:null,_e=new Kr(1),Te="function"==typeof Ee?Ee:function(r){return _e[0]=r,_e[0]};function xe(r,t){if(!(this instanceof xe))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!dr(r))throw new TypeError(I("invalid argument. Real component must be a number. Value: `%s`.",r));if(!dr(t))throw new TypeError(I("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return we(this,"re",Te(r)),we(this,"im",Te(t)),this}function Ve(r){return r instanceof be||r instanceof xe||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Ae(r){return Ut(r/2)}function je(){return"function"==typeof fr&&"symbol"==typeof fr("foo")&&ar(fr,"iterator")&&"symbol"==typeof fr.iterator}Y(xe,"name","Complex64"),Y(xe,"BYTES_PER_ELEMENT",4),Y(xe.prototype,"BYTES_PER_ELEMENT",4),Y(xe.prototype,"byteLength",8),Y(xe.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),Y(xe.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Se=je()?Symbol.iterator:null;function Fe(r,t,e){U(r,t,{configurable:!1,enumerable:!1,get:e})}function Le(r){return r.re}function Oe(r){return r.im}function Ie(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(Ht(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!Ve(n))return new TypeError(I("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));t.push(Le(n),Oe(n))}return t}var ke=2*Kr.BYTES_PER_ELEMENT,Be=je();function Re(r){return r instanceof Ce||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Pe(r){return r===Ce||"Complex128Array"===r.name}function Me(r,t){return new xe(r[t*=2],r[t+1])}function Ce(){var r,t,e,n;if(t=arguments.length,!(this instanceof Ce))return 0===t?new Ce:1===t?new Ce(arguments[0]):2===t?new Ce(arguments[0],arguments[1]):new Ce(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Kr(0);else if(1===t)if(Gt(arguments[0]))e=new Kr(2*arguments[0]);else if(Dt(arguments[0]))if((n=(e=arguments[0]).length)&&Qr(e)&&Ve(e[0])){if(e=function(r,t){var e,n,o,i;for(e=t.length,i=0,o=0;oe.byteLength-r)throw new RangeError(I("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*ke));e=new Kr(e,r,2*n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length/2),this}function Ne(r){return r.re}function Ue(r){return r.im}function Ye(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(Ht(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!Ve(n))return new TypeError(I("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));t.push(Ne(n),Ue(n))}return t}Y(Ce,"BYTES_PER_ELEMENT",ke),Y(Ce,"name","Complex64Array"),Y(Ce,"from",(function(r){var t,e,n,o,i,a,f,u,s,l,h,c;if(!de(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!de(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Re(r)){if(u=r.length,n){for(i=(o=new this(u))._buffer,c=0,h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(re(r)&&Be&&de(r[Se])){if(!de((i=r[Se]()).next))throw new TypeError(I("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,t,e){var n,o,i,a;for(n=[],a=-1;!(o=r.next()).done;)if(a+=1,Ht(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!Ve(i))return new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));n.push(Le(i),Oe(i))}return n}(i,n,t):Ie(i),a instanceof Error)throw a;for(i=(o=new this(u=a.length/2))._buffer,h=0;h=this._length))return Me(this._buffer,r)})),Fe(Ce.prototype,"buffer",(function(){return this._buffer.buffer})),Fe(Ce.prototype,"byteLength",(function(){return this._buffer.byteLength})),Fe(Ce.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(Ce.prototype,"BYTES_PER_ELEMENT",Ce.BYTES_PER_ELEMENT),Y(Ce.prototype,"copyWithin",(function(r,t){if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*t):this._buffer.copyWithin(2*r,2*t,2*arguments[2]),this})),Y(Ce.prototype,"entries",(function(){var r,t,e,n,o,i;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._buffer,e=this._length,i=-1,Y(t={},"next",(function(){return i+=1,o||i>=e?{done:!0}:{value:[i,Me(n,i)],done:!1}})),Y(t,"return",(function(r){return o=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.entries()})),t})),Y(Ce.prototype,"every",(function(r,t){var e,n;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Ut(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(a=Le(r),f=Oe(r),u=t;u=0;n--)if(o=Me(e,n),r.call(t,o,n,this))return o})),Y(Ce.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(o=Me(e,n),r.call(t,o,n,this))return n;return-1})),Y(Ce.prototype,"forEach",(function(r,t){var e,n,o;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return Me(this._buffer,r)})),Y(Ce.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Le(r),i=Oe(r),e=this._buffer,a=t;a1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Le(r),i=Oe(r),e=this._buffer,a=t;a=e?{done:!0}:{value:o,done:!1}})),Y(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.keys()})),t})),Y(Ce.prototype,"lastIndexOf",(function(r,t){var e,n,o,i,a;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(o=Le(r),i=Oe(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),Fe(Ce.prototype,"length",(function(){return this._length})),Y(Ce.prototype,"map",(function(r,t){var e,n,o,i,a;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,e=(o=new this.constructor(this._length))._buffer,i=0;i1)n=t,i=0;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Me(e,0),i=1}for(;i1)n=t,i=o-1;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Me(e,o-1),i=o-2}for(;i>=0;i--)n=r(n,Me(e,i),i,this);return n})),Y(Ce.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ve(r)){if(e>=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Le(r),void(n[e+1]=Oe(r))}if(Re(r)){if(e+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,s=n.byteOffset+e*ke,t.buffer===n.buffer&&t.byteOffsets){for(o=new Kr(t.length),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,s=n.byteOffset+e*ke,t.buffer===n.buffer&&t.byteOffsets){for(o=new Kr(a),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,u=0;uf&&(t=f)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*ke):(o=t-r,e=n.byteOffset+r*ke),new this.constructor(n.buffer,e,o<0?0:o)})),Y(Ce.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!tr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e?{done:!0}:{value:Me(o,i),done:!1}})),Y(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(r,Se,(function(){return t.values()})),r})),Y(Ce.prototype,"with",(function(r,t){var e,n,o;if(!Re(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(o=this._length,r<0&&(r+=o),r<0||r>=o)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Ve(t))throw new TypeError(I("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(e=(n=new this.constructor(this._buffer))._buffer)[2*r]=Le(t),e[2*r+1]=Oe(t),n}));var We=2*Nr.BYTES_PER_ELEMENT,Ze=je();function $e(r){return r instanceof Xe||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Ge(r){return r===Xe||"Complex64Array"===r.name}function Ke(r,t){return new be(r[t*=2],r[t+1])}function Xe(){var r,t,e,n;if(t=arguments.length,!(this instanceof Xe))return 0===t?new Xe:1===t?new Xe(arguments[0]):2===t?new Xe(arguments[0],arguments[1]):new Xe(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Nr(0);else if(1===t)if(Gt(arguments[0]))e=new Nr(2*arguments[0]);else if(Dt(arguments[0]))if((n=(e=arguments[0]).length)&&Qr(e)&&Ve(e[0])){if(e=function(r,t){var e,n,o,i;for(e=t.length,i=0,o=0;oe.byteLength-r)throw new RangeError(I("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*We));e=new Nr(e,r,2*n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length/2),this}function ze(r){var t,e;for(t=[];!(e=r.next()).done;)t.push(ae(e.value));return t}Y(Xe,"BYTES_PER_ELEMENT",We),Y(Xe,"name","Complex128Array"),Y(Xe,"from",(function(r){var t,e,n,o,i,a,f,u,s,l,h,c;if(!de(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!de(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if($e(r)){if(u=r.length,n){for(i=(o=new this(u))._buffer,c=0,h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(re(r)&&Ze&&de(r[Se])){if(!de((i=r[Se]()).next))throw new TypeError(I("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,t,e){var n,o,i,a;for(n=[],a=-1;!(o=r.next()).done;)if(a+=1,Ht(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!Ve(i))return new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));n.push(Ne(i),Ue(i))}return n}(i,n,t):Ye(i),a instanceof Error)throw a;for(i=(o=new this(u=a.length/2))._buffer,h=0;h=this._length))return Ke(this._buffer,r)})),Fe(Xe.prototype,"buffer",(function(){return this._buffer.buffer})),Fe(Xe.prototype,"byteLength",(function(){return this._buffer.byteLength})),Fe(Xe.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(Xe.prototype,"BYTES_PER_ELEMENT",Xe.BYTES_PER_ELEMENT),Y(Xe.prototype,"copyWithin",(function(r,t){if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*t):this._buffer.copyWithin(2*r,2*t,2*arguments[2]),this})),Y(Xe.prototype,"entries",(function(){var r,t,e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,n=this._length,i=-1,a=-2,Y(e={},"next",(function(){var t;return i+=1,o||i>=n?{done:!0}:(t=new be(r[a+=2],r[a+1]),{value:[i,t],done:!1})})),Y(e,"return",(function(r){return o=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(e,Se,(function(){return t.entries()})),e})),Y(Xe.prototype,"every",(function(r,t){var e,n;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Ut(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(a=Ne(r),f=Ue(r),u=t;u=0;n--)if(o=Ke(e,n),r.call(t,o,n,this))return o})),Y(Xe.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(o=Ke(e,n),r.call(t,o,n,this))return n;return-1})),Y(Xe.prototype,"forEach",(function(r,t){var e,n,o;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return Ke(this._buffer,r)})),Fe(Xe.prototype,"length",(function(){return this._length})),Y(Xe.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Ne(r),i=Ue(r),e=this._buffer,a=t;a1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Ne(r),i=Ue(r),e=this._buffer,a=t;a=e?{done:!0}:{value:o,done:!1}})),Y(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.keys()})),t})),Y(Xe.prototype,"lastIndexOf",(function(r,t){var e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ve(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(o=Ne(r),i=Ue(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),Y(Xe.prototype,"map",(function(r,t){var e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,e=(o=new this.constructor(this._length))._buffer,i=0;i1)n=t,i=0;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Ke(e,0),i=1}for(;i1)n=t,i=o-1;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Ke(e,o-1),i=o-2}for(;i>=0;i--)n=r(n,Ke(e,i),i,this);return n})),Y(Xe.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ve(r)){if(e>=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Ne(r),void(n[e+1]=Ue(r))}if($e(r)){if(e+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,s=n.byteOffset+e*We,t.buffer===n.buffer&&t.byteOffsets){for(o=new Nr(t.length),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,s=n.byteOffset+e*We,t.buffer===n.buffer&&t.byteOffsets){for(o=new Nr(a),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,u=0;uf&&(t=f)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*We):(o=t-r,e=n.byteOffset+r*We),new this.constructor(n.buffer,e,o<0?0:o)})),Y(Xe.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!pr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e?{done:!0}:{value:Ke(o,i),done:!1}})),Y(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(r,Se,(function(){return t.values()})),r})),Y(Xe.prototype,"with",(function(r,t){var e,n,o;if(!$e(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(o=this._length,r<0&&(r+=o),r<0||r>=o)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Ve(t))throw new TypeError(I("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(e=(n=new this.constructor(this._buffer))._buffer)[2*r]=Ne(t),e[2*r+1]=Ue(t),n}));var He=qr.BYTES_PER_ELEMENT,Je=je();function De(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===He}function qe(r){return r===Qe}function Qe(){var r,t,e,n,o;if(t=arguments.length,!(this instanceof Qe))return 0===t?new Qe:1===t?new Qe(arguments[0]):2===t?new Qe(arguments[0],arguments[1]):new Qe(arguments[0],arguments[1],arguments[2]);if(0===t)e=new qr(0);else if(1===t)if(Gt(o=arguments[0]))e=new qr(o);else if(Dt(o))e=function(r,t){var e,n;for(e=t.length,n=0;ne.byteLength-r)throw new RangeError(I("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*He));e=new qr(e,r,n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length),this}Y(Qe,"BYTES_PER_ELEMENT",He),Y(Qe,"name","BooleanArray"),Y(Qe,"from",(function(r){var t,e,n,o,i,a,f,u,s;if(!de(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((e=arguments.length)>1){if(!de(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),i=(o=new this(u))._buffer,s=0;s=e))return ae(t[r])})),Fe(Qe.prototype,"buffer",(function(){return this._buffer.buffer})),Fe(Qe.prototype,"byteLength",(function(){return this._buffer.byteLength})),Fe(Qe.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(Qe.prototype,"BYTES_PER_ELEMENT",Qe.BYTES_PER_ELEMENT),Y(Qe.prototype,"copyWithin",(function(r,t){if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(r,t):this._buffer.copyWithin(r,t,arguments[2]),this})),Y(Qe.prototype,"entries",(function(){var r,t,e,n,o,i;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,n=this._buffer,e=this._length,i=-1,Y(t={},"next",(function(){return i+=1,o||i>=e?{done:!0}:{value:[i,ae(n[i])],done:!1}})),Y(t,"return",(function(r){return o=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.entries()})),t})),Y(Qe.prototype,"every",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Wt(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(i=r?1:0,a=t;a=0;o--)if(n=ae(e[o]),r.call(t,n,o,this))return n})),Y(Qe.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,o=this._length-1;o>=0;o--)if(n=ae(e[o]),r.call(t,n,o,this))return o;return-1})),Y(Qe.prototype,"forEach",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return ae(this._buffer[r])})),Y(Qe.prototype,"includes",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ie(r))throw new TypeError(I("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(e=this._buffer,n=t;n1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(e=this._buffer,n=t;n0){if(!tr(r))throw new TypeError(I("invalid argument. First argument must be a string. Value: `%s`.",r))}else r=",";for(t=this._buffer,e=[],n=0;n=e?{done:!0}:{value:o,done:!1}})),Y(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(t,Se,(function(){return r.keys()})),t})),Y(Qe.prototype,"lastIndexOf",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ie(r))throw new TypeError(I("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(e=this._buffer,n=t;n>=0;n--)if(r===ae(e[n]))return n;return-1})),Fe(Qe.prototype,"length",(function(){return this._length})),Y(Qe.prototype,"map",(function(r,t){var e,n,o,i;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!de(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(o=this._buffer,e=(n=new this.constructor(this._length))._buffer,i=0;i1)o=t,i=0;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");o=ae(e[0]),i=1}for(;i1)o=t,i=n-1;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");o=ae(e[n-1]),i=n-2}for(;i>=0;i--)o=r(o,ae(e[i]),i,this);return o})),Y(Qe.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,e=this._length,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Dt(r)){if(e+(i=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=De(r)?r._buffer:r,f=n.byteOffset+e*He,t.buffer===n.buffer&&t.byteOffsetf){for(o=new qr(t.length),a=0;a=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));n[e]=r?1:0}})),Y(Qe.prototype,"slice",(function(r,t){var e,n,o,i,a,f;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(i=this._buffer,a=this._length,0===arguments.length)r=0,t=a;else{if(!Wt(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a)<0&&(r=0),1===arguments.length)t=a;else{if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a)<0&&(t=0):t>a&&(t=a)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*He):(o=t-r,e=n.byteOffset+r*He),new this.constructor(n.buffer,e,o<0?0:o)})),Y(Qe.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)n=[];else{if(!tr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e?{done:!0}:{value:ae(o[i]),done:!1}})),Y(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Se&&Y(r,Se,(function(){return t.values()})),r})),Y(Qe.prototype,"with",(function(r,t){var e,n;if(!De(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Wt(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(n=this._length,r<0&&(r+=n),r<0||r>=n)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ie(t))throw new TypeError(I("invalid argument. Second argument must be a boolean. Value: `%s`.",t));return(e=new this.constructor(this._buffer))._buffer[r]=t?1:0,e}));var rn=[Nr,Kr,dt,pt,St,Tt,Mt,qr,kt,Ce,Xe,Qe],tn=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],en=tn.length;function nn(r){var t=function(r){var t;if(Qr(r))return"generic";if(et(r))return null;for(t=0;t0)for(l=0;l0)for(u=0;u0?0:(1-r)*t}(r,n))}function sn(r){var t,e;if(t=[],r<=0)return t;for(e=0;e=0&&a=0&&!(((s=r[i])<0?-s:s)<=e);)r[i+1]=s,t[a+1]=t[a],i-=1,a-=1;r[i+1]=f,t[a+1]=u,n+=1,o+=1}}(t=rr(t),e),{sh:r=function(r,t){var e,n;for(e=[],n=0;n0}function pn(r){return Zt(r)&&r.valueOf()>0}function yn(r){return cn(r)||pn(r)}function gn(r){return Object.keys(Object(r))}Y(un,"ndarray",fn),Y(sn,"assign",(function(r,t,e){var n=nn(r);return n.accessorProtocol?"complex128"===n.dtype?ln(r,Ur(r,0),t,e):"complex64"===n.dtype?ln(r,Xr(r,0),t,e):function(r,t,e){var n,o,i,a;for(n=r.data,o=r.accessors[1],a=e,i=0;a>=0&&a=0&&o=0&&t=0&&r.length<=st&&ar(r,"callee")&&!An(r,"callee")},Sn=Array.prototype.slice,Fn=An((function(){}),"prototype"),Ln=!An({toString:null},"toString");function On(r,t,e){var n,o;if(!Dt(r)&&!tr(r))throw new TypeError(I("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(0===(n=r.length))return-1;if(3===arguments.length){if(!Wt(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=n)return-1;o=e}else(o=n+e)<0&&(o=0)}else o=0;if(Tn(t)){for(;o0&&!ar(r,"0"))for(f=0;f1){if(!Gn(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ar(t,"duplicates")&&!ie(s=t.duplicates))throw new TypeError(I("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",s))}if(n=(e=Un(r)).length,a={},s)for(u=0;ut&&(t=n)}return(n=Hn.BLOCK_SIZE_IN_BYTES/t|0)>0?n:1}([r])}function Dn(r,t,e,n,o,i){var a,f,u,s,l;for(a=r.length,f=1,l=0;l=f&&(o=f-1);else if("wrap"===i)o<0?(o+=f)<0&&0!=(o%=f)&&(o+=f):o>=f&&(o-=f)>=f&&(o%=f);else if("normalize"===i&&o<0&&(o+=f),o<0||o>=f)throw new RangeError(I("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",f,o));if(u=e,yr(n)){for(l=0;l=0;l--)o-=s=o%r[l],o/=r[l],u+=s*t[l];return u}var qn="throw",Qn="throw",ro="throw",to=[function(r){return!!r.data[r.offset]},function(r){var t,e,n,o,i;for(n=r.shape[0],e=r.strides[0],o=r.offset,t=r.data,i=0;i0;)for(g0;)for(y0;)for(b0;)for(w0;)for(d0;)for(V0;)for(x0;)for(T0;)for(_0;)for(L0;)for(F0;)for(S0;)for(j0;)for(A0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(L0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(B0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(m0;)for(g0;)for(E0;)for(b0;)for(w0;)for(A0;)for(V0;)for(x0;)for(T0;)for(O0;)for(L0;)for(F0;)for(S0;)for(j0;)for(P0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(er0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(g0;)for(y0;)for(b0;)for(w0;)for(d0;)for(V0;)for(x0;)for(T0;)for(_0;)for(L0;)for(F0;)for(S0;)for(j0;)for(A0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(L0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(B0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport isNumber from './is_number.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar f;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\tf = parseFloat( token.arg );\n\t\t\t\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\t\t\t\tif ( !isNumber( token.arg ) ) {\n\t\t\t\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t\t\t\t}\n\t\t\t\t\t// Case: NaN, Infinity, or -Infinity\n\t\t\t\t\tf = token.arg;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( f, token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\t// Check for an escaped percent sign `%%`...\n\t\tif ( match[ 6 ] === '%' ) {\n\t\t\ttokens.push( '%' );\n\t\t} else {\n\t\t\ttokens.push( parse( match ) );\n\t\t}\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils-define-property\n*\n* @example\n* import defineProperty from '@stdlib/utils-define-property';\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nimport hasDefinePropertySupport from './has_define_property_support.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './define_property.js';\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @param {NonNegativeInteger} offset - index offset\n* @returns {Array} linear indices\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*/\nfunction minmaxViewBufferIndex( shape, strides, offset ) {\n\tvar ndims;\n\tvar min;\n\tvar max;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tmin = offset;\n\tmax = offset;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( shape[ i ] === 0 ) {\n\t\t\treturn [ offset, offset ];\n\t\t}\n\t\ts = strides[ i ];\n\t\tif ( s > 0 ) {\n\t\t\tmax += s * ( shape[i]-1 );\n\t\t} else if ( s < 0 ) {\n\t\t\tmin += s * ( shape[i]-1 ); // decrements min\n\t\t}\n\t}\n\treturn [ min, max ];\n}\n\n\n// EXPORTS //\n\nexport default minmaxViewBufferIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.\n*\n* @module @stdlib/ndarray-base-minmax-view-buffer-index\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view and assigns results to a provided output array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @param {NonNegativeInteger} offset - index offset\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} linear indices\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 10, 109 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 0, 99 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 10, 109 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 0, 99 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*/\nfunction minmaxViewBufferIndex( shape, strides, offset, out ) {\n\tvar ndims;\n\tvar min;\n\tvar max;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tmin = offset;\n\tmax = offset;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( shape[ i ] === 0 ) {\n\t\t\tout[ 0 ] = offset;\n\t\t\tout[ 1 ] = offset;\n\t\t\treturn out;\n\t\t}\n\t\ts = strides[ i ];\n\t\tif ( s > 0 ) {\n\t\t\tmax += s * ( shape[i]-1 );\n\t\t} else if ( s < 0 ) {\n\t\t\tmin += s * ( shape[i]-1 ); // decrements min\n\t\t}\n\t}\n\tout[ 0 ] = min;\n\tout[ 1 ] = max;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default minmaxViewBufferIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the number of elements in an array.\n*\n* @param {(NonNegativeIntegerArray|EmptyArray)} shape - array shape\n* @returns {NonNegativeInteger} number of elements\n*\n* @example\n* var n = numel( [ 3, 3, 3 ] );\n* // returns 27\n*/\nfunction numel( shape ) {\n\tvar ndims;\n\tvar n;\n\tvar i;\n\n\tndims = shape.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0;\n\t}\n\tn = 1;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tn *= shape[ i ];\n\t}\n\treturn n;\n}\n\n\n// EXPORTS //\n\nexport default numel;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tlen = x.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( x[ i ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default copy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasSymbols from '@stdlib/assert-has-symbol-support';\n\n\n// VARIABLES //\n\nvar FLG = hasSymbols();\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.toStringTag` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.toStringTag` support\n*\n* @example\n* var bool = hasToStringTagSupport();\n* // returns \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) 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 valueOf = String.prototype.valueOf; // non-generic\n\n\n// EXPORTS //\n\nexport default valueOf;\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 test from './try2valueof.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string object\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns false\n*/\nfunction isString( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof String ) {\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 String]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport valueOf from './valueof.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to extract a string value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a string can be extracted\n*/\nfunction test( value ) {\n\ttry {\n\t\tvalueOf.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 string.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a string\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*/\nfunction isString( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether an input value is the string representing column-major order.\n*\n* @param {*} v - value to test\n* @returns {boolean} boolean result\n*\n* @example\n* var bool = isColumnMajorString( 'column-major' );\n* // returns true\n*\n* bool = isColumnMajorString( 'row-major' );\n* // returns false\n*\n* bool = isColumnMajorString( 'foo' );\n* // returns false\n*/\nfunction isColumnMajorString( v ) {\n\treturn ( v === 'column-major' );\n}\n\n\n// EXPORTS //\n\nexport default isColumnMajorString;\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 isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a stride array from an array shape (row-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} array strides\n*/\nfunction rowmajor( shape ) {\n\tvar ndims;\n\tvar out;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tout = [];\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tout.push( 0 );\n\t}\n\ts = 1;\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n/**\n* Generates a stride array from an array shape (column-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} array strides\n*/\nfunction columnmajor( shape ) {\n\tvar out;\n\tvar s;\n\tvar i;\n\n\tout = [];\n\ts = 1;\n\tfor ( i = 0; i < shape.length; i++ ) {\n\t\tout.push( s );\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates a stride array from an array shape.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @returns {Array} array strides\n*\n* @example\n* var s = shape2strides( [ 3, 2 ], 'row-major' );\n* // returns [ 2, 1 ]\n*\n* s = shape2strides( [ 3, 2 ], 'column-major' );\n* // returns [ 1, 3 ]\n*/\nfunction shape2strides( shape, order ) {\n\tif ( isColumnMajor( order ) ) {\n\t\treturn columnmajor( shape );\n\t}\n\treturn rowmajor( shape );\n}\n\n\n// EXPORTS //\n\nexport default shape2strides;\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 string.\n*\n* @module @stdlib/assert-is-string\n*\n* @example\n* import isString from '@stdlib/assert-is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 5 );\n* // returns false\n*\n* @example\n* import { isObject as isString } from '@stdlib/assert-is-string';\n*\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 'beep' );\n* // returns false\n*\n* @example\n* import { isPrimitive as isString } from '@stdlib/assert-is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns false\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* Generate a stride array from an array shape.\n*\n* @module @stdlib/ndarray-base-shape2strides\n*\n* @example\n* import shape2strides from '@stdlib/ndarray-base-shape2strides';\n*\n* var strides = shape2strides( [ 3, 2 ], 'row-major' );\n* // returns [ 2, 1 ]\n*\n* strides = shape2strides( [ 3, 2 ], 'column-major' );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a stride array from an array shape (row-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*/\nfunction rowmajor( shape, out ) {\n\tvar ndims;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\ts = 1;\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n/**\n* Generates a stride array from an array shape (column-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*/\nfunction columnmajor( shape, out ) {\n\tvar s;\n\tvar i;\n\n\ts = 1;\n\tfor ( i = 0; i < shape.length; i++ ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates a stride array from an array shape.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*\n* @example\n* var strides = [ 0, 0 ];\n*\n* var out = shape2strides( [ 3, 2 ], 'row-major', strides );\n* // returns [ 2, 1 ]\n*\n* var bool = ( out === strides );\n* // returns true\n*\n* out = shape2strides( [ 3, 2 ], 'column-major', strides );\n* // returns [ 1, 3 ]\n*/\nfunction shape2strides( shape, order, out ) {\n\tif ( isColumnMajor( order ) ) {\n\t\treturn columnmajor( shape, out );\n\t}\n\treturn rowmajor( shape, out );\n}\n\n\n// EXPORTS //\n\nexport default shape2strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isString } from '@stdlib/assert-is-string';\nimport shape2strides from '@stdlib/ndarray-base-shape2strides';\nimport copyIndexed from '@stdlib/array-base-copy-indexed';\n\n\n// VARIABLES //\n\nvar ROW_MAJOR = 'row-major';\n\n\n// MAIN //\n\n/**\n* Returns the strides of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @param {boolean} copy - boolean indicating whether to explicitly copy the value assigned to the input ndarray's `strides` property\n* @returns {IntegerArray} strides\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var out = strides( zeros( [ 3, 3, 3 ] ), false );\n* // returns [ 9, 3, 1 ]\n*/\nfunction strides( x, copy ) {\n\tvar ord;\n\tvar sh;\n\tvar st;\n\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\tsh = x.shape;\n\t\tif ( sh.length === 0 ) {\n\t\t\treturn [ 0 ];\n\t\t}\n\t\tord = x.order;\n\t\tif ( !isString( ord ) ) {\n\t\t\tord = ROW_MAJOR;\n\t\t}\n\t\treturn shape2strides( sh, ord );\n\t}\n\tif ( copy ) {\n\t\treturn copyIndexed( st );\n\t}\n\treturn st;\n}\n\n\n// EXPORTS //\n\nexport default strides;\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// 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) 2023 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 strides2offset from '@stdlib/ndarray-base-strides2offset';\n\n\n// MAIN //\n\n/**\n* Returns the index offset specifying the underlying buffer index of the first iterated ndarray element.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {NonNegativeInteger} index offset\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var n = offset( zeros( [ 3, 3, 3 ] ) );\n* // returns 0\n*/\nfunction offset( x ) {\n\tvar st;\n\tvar sh;\n\tvar o;\n\n\to = x.offset;\n\tif ( isNumber( o ) ) {\n\t\treturn o;\n\t}\n\tsh = x.shape;\n\tif ( sh.length === 0 ) {\n\t\treturn 0;\n\t}\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\treturn 0;\n\t}\n\treturn strides2offset( sh, st );\n}\n\n\n// EXPORTS //\n\nexport default offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a multidimensional array based on a stride array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var shape = [ 2, 3, 10 ];\n* var strides = [ 30, -10, 1 ];\n*\n* var offset = strides2offset( shape, strides );\n* // returns 20\n*/\nfunction strides2offset( shape, strides ) {\n\tvar offset;\n\tvar ndims;\n\tvar i;\n\n\tndims = shape.length;\n\toffset = 0;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( strides[ i ] < 0 ) {\n\t\t\t// Note that, since the stride is negative, this operation increments, not decrements, the offset...\n\t\t\toffset -= strides[ i ] * ( shape[ i ]-1 );\n\t\t}\n\t}\n\treturn offset;\n}\n\n\n// EXPORTS //\n\nexport default strides2offset;\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// MAIN //\n\n/**\n* Computes the absolute value of a double-precision floating-point number `x`.\n*\n* @param {number} x - input value\n* @returns {number} absolute value\n*\n* @example\n* var v = abs( -1.0 );\n* // returns 1.0\n*\n* @example\n* var v = abs( 2.0 );\n* // returns 2.0\n*\n* @example\n* var v = abs( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( -0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( NaN );\n* // returns NaN\n*/\nfunction abs( x ) {\n\treturn Math.abs( x ); // eslint-disable-line stdlib/no-builtin-math\n}\n\n\n// EXPORTS //\n\nexport default abs;\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 abs from '@stdlib/math-base-special-abs';\n\n\n// MAIN //\n\n/**\n* Determines the order of a multidimensional array based on a provided stride array.\n*\n* @param {IntegerArray} strides - stride array\n* @returns {integer} order\n*\n* @example\n* var order = strides2order( [ 2, 1 ] );\n* // returns 1\n*\n* order = strides2order( [ 1, 2 ] );\n* // returns 2\n*\n* order = strides2order( [ 1, 1, 1 ] );\n* // returns 3\n*\n* order = strides2order( [ 2, 3, 1 ] );\n* // returns 0\n*/\nfunction strides2order( strides ) {\n\tvar column;\n\tvar ndims;\n\tvar row;\n\tvar s1;\n\tvar s2;\n\tvar i;\n\n\tndims = strides.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0|0; // 'none'\n\t}\n\tcolumn = true;\n\trow = true;\n\n\ts1 = abs( strides[ 0 ] );\n\tfor ( i = 1; i < ndims; i++ ) {\n\t\ts2 = abs( strides[ i ] );\n\t\tif ( column && s2 < s1 ) {\n\t\t\tcolumn = false;\n\t\t} else if ( row && s2 > s1 ) {\n\t\t\trow = false;\n\t\t}\n\t\tif ( row || column ) {\n\t\t\ts1 = s2;\n\t\t} else {\n\t\t\treturn 0|0; // 'none'\n\t\t}\n\t}\n\tif ( row && column ) {\n\t\treturn 3|0; // 'both'\n\t}\n\tif ( row ) {\n\t\treturn 1|0; // 'row-major'\n\t}\n\treturn 2|0; // 'column-major'\n}\n\n\n// EXPORTS //\n\nexport default strides2order;\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) 2023 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 isString } from '@stdlib/assert-is-string';\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// VARIABLES //\n\nvar ROW_MAJOR = 'row-major';\nvar COLUMN_MAJOR = 'column-major';\n\n\n// MAIN //\n\n/**\n* Returns the layout order of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {(string|null)} layout order\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'order': 'row-major'\n* });\n*\n* var out = order( x );\n* // returns 'row-major'\n*/\nfunction order( x ) {\n\tvar st;\n\tvar o;\n\n\to = x.order;\n\tif ( isString( o ) ) {\n\t\treturn o;\n\t}\n\t// Try to infer the layout order from the strides array...\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\treturn ROW_MAJOR; // WARNING: default to row-major for ndarray-like objects lacking strides. This may or may not be accurate, and we're defaulting to row-major here based on the belief that row-major is more likely given that, e.g., JavaScript arrays are similar to C arrays (i.e., stored in row-major order).\n\t}\n\to = strides2order( st );\n\tif ( o === 1 || o === 3 ) {\n\t\treturn ROW_MAJOR; // for o == 3 (both row- and column-major; e.g., one-dimensional ndarrays), default to row-major\n\t}\n\tif ( o === 2 ) {\n\t\treturn COLUMN_MAJOR;\n\t}\n\t// o === 0\n\tif ( x.shape.length === 0 ) {\n\t\treturn ROW_MAJOR; // default to row-major for zero-dimensional ndarrays\n\t}\n\t// Case: mixed strides (e.g., [ 2, 3, 1 ] )\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default order;\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 isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport accessorSetter from '@stdlib/array-base-accessor-setter';\nimport getter from '@stdlib/array-base-getter';\nimport setter from '@stdlib/array-base-setter';\nimport numel from '@stdlib/ndarray-base-numel';\nimport getDType from '@stdlib/ndarray-base-dtype';\nimport getShape from '@stdlib/ndarray-base-shape';\nimport getStrides from '@stdlib/ndarray-base-strides';\nimport getOffset from '@stdlib/ndarray-base-offset';\nimport getOrder from '@stdlib/ndarray-base-order';\nimport getData from '@stdlib/ndarray-base-data-buffer';\n\n\n// MAIN //\n\n/**\n* Converts an ndarray-like object to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding ndarray meta data to ensure that internal functions operating on ndarrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **ref**: reference to the original ndarray-like object.\n* - **dtype**: underlying data type.\n* - **data**: data buffer.\n* - **length**: number of elements.\n* - **shape**: array dimensions.\n* - **strides**: array strides.\n* - **offset**: index offset.\n* - **order**: order.\n* - **accessorProtocol**: `boolean` indicating whether the data buffer supports the get/set protocol (i.e., uses accessors for getting and setting elements).\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an ndarray element and whose second element is an accessor for setting an ndarray element.\n*\n* @param {ndarrayLike} x - ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {Object} object containing ndarray meta data\n*\n* @example\n* import array from '@stdlib/ndarray-array';\n*\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] );\n*\n* var obj = ndarraylike2object( x );\n* // returns {...}\n*/\nfunction ndarraylike2object( x ) {\n\tvar xbuf;\n\tvar bool;\n\tvar sh;\n\tvar dt;\n\n\txbuf = getData( x );\n\tsh = getShape( x, true );\n\tdt = getDType( x );\n\n\tbool = isAccessorArray( xbuf );\n\n\treturn {\n\t\t'ref': x,\n\t\t'dtype': dt,\n\t\t'data': xbuf,\n\t\t'length': numel( sh ),\n\t\t'shape': sh,\n\t\t'strides': getStrides( x, true ),\n\t\t'offset': getOffset( x ),\n\t\t'order': getOrder( x ),\n\t\t'accessorProtocol': bool,\n\t\t'accessors': ( bool ) ?\n\t\t\t[ accessorGetter( dt ), accessorSetter( dt ) ] :\n\t\t\t[ getter( dt ), setter( dt ) ]\n\t};\n}\n\n\n// EXPORTS //\n\nexport default ndarraylike2object;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the underlying data buffer of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {Collection} underlying data buffer\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'dtype': 'float64'\n* });\n*\n* var out = data( x );\n* // returns \n*/\nfunction data( x ) {\n\treturn x.data;\n}\n\n\n// EXPORTS //\n\nexport default data;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 copyIndexed from '@stdlib/array-base-copy-indexed';\n\n\n// MAIN //\n\n/**\n* Returns the shape of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @param {boolean} copy - boolean indicating whether to explicitly copy the value assigned to the input ndarray's `shape` property\n* @returns {NonNegativeIntegerArray} shape\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var out = shape( zeros( [ 3, 3, 3 ] ), false );\n* // returns [ 3, 3, 3 ]\n*/\nfunction shape( x, copy ) {\n\tvar sh = x.shape;\n\tif ( copy ) {\n\t\treturn copyIndexed( sh );\n\t}\n\treturn sh;\n}\n\n\n// EXPORTS //\n\nexport default shape;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the data type of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {string} data type\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'dtype': 'float64'\n* });\n*\n* var dt = dtype( x );\n* // returns 'float64'\n*/\nfunction dtype( x ) {\n\treturn x.dtype;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 16; // 8 bytes per float64 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isComplex128Array( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplex128Array( [] );\n* // returns false\n*/\nfunction isComplex128Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex128Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex128array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 8; // 4 bytes per float32 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var bool = isComplex64Array( new Complex64Array( 10 ) );\n* // returns true\n*\n* bool = isComplex64Array( [] );\n* // returns false\n*/\nfunction isComplex64Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex64Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex64array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex64Array;\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 hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float64Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float64Array\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat64Array( [] );\n* // returns false\n*/\nfunction isFloat64Array( value ) {\n\treturn (\n\t\t( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float64Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat64Array;\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 double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float64\n*\n* @example\n* import ctor from '@stdlib/array-float64';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat64ArraySupport from '@stdlib/assert-has-float64array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\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// MAIN //\n\nvar main = ( typeof Float64Array === 'function' ) ? Float64Array : 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 Float64Array === 'function' ) ? Float64Array : 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 isFloat64Array from '@stdlib/assert-is-float64array';\nimport GlobalFloat64Array from './float64array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float64Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float64Array` support\n*\n* @example\n* var bool = hasFloat64ArraySupport();\n* // returns \n*/\nfunction hasFloat64ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat64Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );\n\t\tbool = (\n\t\t\tisFloat64Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.14 &&\n\t\t\tarr[ 2 ] === -3.14 &&\n\t\t\tarr[ 3 ] !== arr[ 3 ]\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 hasFloat64ArraySupport;\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 double-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) 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 Float64Array from '@stdlib/array-float64';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex128Array` as a `Float64Array`.\n*\n* @param {Complex128Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} `Float64Array` view\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\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* 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/**\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) 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 Float32Array from '@stdlib/array-float32';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex64Array` as a `Float32Array`.\n*\n* @param {Complex64Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} `Float32Array` view\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\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 hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8Array\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8Array( [] );\n* // returns false\n*/\nfunction isUint8Array( value ) {\n\treturn (\n\t\t( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8Array;\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 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint8\n*\n* @example\n* import ctor from '@stdlib/array-uint8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ArraySupport from '@stdlib/assert-has-uint8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\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// MAIN //\n\nvar main = ( typeof Uint8Array === 'function' ) ? Uint8Array : 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 Uint8Array === 'function' ) ? Uint8Array : 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 isUint8Array from '@stdlib/assert-is-uint8array';\nimport UINT8_MAX from '@stdlib/constants-uint8-max';\nimport GlobalUint8Array from './uint8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8Array` support\n*\n* @example\n* var bool = hasUint8ArraySupport();\n* // returns \n*/\nfunction hasUint8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];\n\t\tarr = new GlobalUint8Array( arr );\n\t\tbool = (\n\t\t\tisUint8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\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 hasUint8ArraySupport;\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 8-bit unsigned integers 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 nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar f;\n\n\n// FUNCTIONS //\n\n/**\n* Tests if a value is an array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an array\n*\n* @example\n* var bool = isArray( [] );\n* // returns true\n*\n* @example\n* var bool = isArray( {} );\n* // returns false\n*/\nfunction isArray( value ) {\n\treturn ( nativeClass( value ) === '[object Array]' );\n}\n\n\n// MAIN //\n\nif ( Array.isArray ) {\n\tf = Array.isArray;\n} else {\n\tf = isArray;\n}\n\n\n// EXPORTS //\n\nexport default f;\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 isArray from '@stdlib/assert-is-array';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array function\n*\n* @example\n* import isOdd from '@stdlib/assert-is-odd';\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arrayfcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArray( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default arrayfcn;\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 object-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is object-like\n*\n* @example\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( [] );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( null );\n* // returns false\n*/\nfunction isObjectLike( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObjectLike;\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 isObjectLike from '@stdlib/assert-is-object-like';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Buffer instance.\n*\n* @param {*} value - value to validate\n* @returns {boolean} boolean indicating if a value is a Buffer instance\n*\n* @example\n* var v = isBuffer( new Buffer( 'beep' ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( new Buffer( [1,2,3,4] ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( {} );\n* // returns false\n*\n* @example\n* var v = isBuffer( [] );\n* // returns false\n*/\nfunction isBuffer( value ) {\n\treturn (\n\t\tisObjectLike( value ) &&\n\t\t(\n\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\tvalue._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)\n\t\t\t(\n\t\t\t\tvalue.constructor &&\n\n\t\t\t\t// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions\n\t\t\t\ttypeof value.constructor.isBuffer === 'function' &&\n\t\t\t\tvalue.constructor.isBuffer( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBuffer;\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// MAIN //\n\n/**\n* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @returns {RegExp} regular expression\n*\n* @example\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\nfunction reFunctionName() {\n\treturn /^\\s*function\\s*([^(]*)/i;\n}\n\n\n// EXPORTS //\n\nexport default reFunctionName;\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 object-like.\n*\n* @module @stdlib/assert-is-object-like\n*\n* @example\n* import isObjectLike from '@stdlib/assert-is-object-like';\n*\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* bool = isObjectLike( [] );\n* // returns true\n*\n* bool = isObjectLike( null );\n* // returns false\n*\n* @example\n* import { isObjectLikeArray as isObjectLike } from '@stdlib/assert-is-object-like';\n*\n* var bool = isObjectLike( [ {}, [] ] );\n* // returns true\n*\n* bool = isObjectLike( [ {}, '3.0' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport arrayfun from '@stdlib/assert-tools-array-function';\nimport main from './main.js';\n\n\n// VARIABLES //\n\nvar isObjectLikeArray = arrayfun( main );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isObjectLikeArray', isObjectLikeArray );\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 reFunctionName from './main.js';\n\n\n// MAIN //\n\n/**\n* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* Regular expression: `/^\\s*function\\s*([^(]*)/i`\n*\n* - `/^\\s*`\n* - Match zero or more spaces at beginning\n*\n* - `function`\n* - Match the word `function`\n*\n* - `\\s*`\n* - Match zero or more spaces after the word `function`\n*\n* - `()`\n* - Capture\n*\n* - `[^(]*`\n* - Match anything except a left parenthesis `(` zero or more times\n*\n* - `/i`\n* - ignore case\n*\n* @constant\n* @type {RegExp}\n* @default /^\\s*function\\s*([^(]*)/i\n*/\nvar RE_FUNCTION_NAME = reFunctionName();\n\n\n// EXPORTS //\n\nexport default RE_FUNCTION_NAME;\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';\nimport { REGEXP as RE } from '@stdlib/regexp-function-name';\nimport isBuffer from '@stdlib/assert-is-buffer';\n\n\n// MAIN //\n\n/**\n* Determines the name of a value's constructor.\n*\n* @param {*} v - input value\n* @returns {string} name of a value's constructor\n*\n* @example\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* @example\n* var v = constructorName( 5 );\n* // returns 'Number'\n*\n* @example\n* var v = constructorName( null );\n* // returns 'Null'\n*\n* @example\n* var v = constructorName( undefined );\n* // returns 'Undefined'\n*\n* @example\n* var v = constructorName( function noop() {} );\n* // returns 'Function'\n*/\nfunction constructorName( v ) {\n\tvar match;\n\tvar name;\n\tvar ctor;\n\tname = nativeClass( v ).slice( 8, -1 );\n\tif ( (name === 'Object' || name === 'Error') && v.constructor ) {\n\t\tctor = v.constructor;\n\t\tif ( typeof ctor.name === 'string' ) {\n\t\t\treturn ctor.name;\n\t\t}\n\t\tmatch = RE.exec( ctor.toString() );\n\t\tif ( match ) {\n\t\t\treturn match[ 1 ];\n\t\t}\n\t}\n\tif ( isBuffer( v ) ) {\n\t\treturn 'Buffer';\n\t}\n\treturn name;\n}\n\n\n// EXPORTS //\n\nexport default constructorName;\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/**\n* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @module @stdlib/regexp-function-name\n*\n* @example\n* import reFunctionName from '@stdlib/regexp-function-name';\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport REGEXP from './regexp.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'REGEXP', REGEXP );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128',\n\t'BooleanArray': 'bool'\n};\n\n\n// EXPORTS //\n\nexport default ctor2dtypes;\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 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint32\n*\n* @example\n* import ctor from '@stdlib/array-uint32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint32ArraySupport from '@stdlib/assert-has-uint32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\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 hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint32Array\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint32Array( [] );\n* // returns false\n*/\nfunction isUint32Array( value ) {\n\treturn (\n\t\t( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint32Array;\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* Maximum unsigned 32-bit integer.\n*\n* @module @stdlib/constants-uint32-max\n* @type {uinteger32}\n*\n* @example\n* import UINT32_MAX from '@stdlib/constants-uint32-max';\n* // returns 4294967295\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar UINT32_MAX = 4294967295;\n\n\n// EXPORTS //\n\nexport default UINT32_MAX;\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 Uint32Array === 'function' ) ? Uint32Array : 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 Uint32Array === 'function' ) ? Uint32Array : 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 isUint32Array from '@stdlib/assert-is-uint32array';\nimport UINT32_MAX from '@stdlib/constants-uint32-max';\nimport GlobalUint32Array from './uint32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint32Array` support\n*\n* @example\n* var bool = hasUint32ArraySupport();\n* // returns \n*/\nfunction hasUint32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];\n\t\tarr = new GlobalUint32Array( arr );\n\t\tbool = (\n\t\t\tisUint32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\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 hasUint32ArraySupport;\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 32-bit unsigned integers 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/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int32\n*\n* @example\n* import ctor from '@stdlib/array-int32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt32ArraySupport from '@stdlib/assert-has-int32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt32ArraySupport() ) {\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 hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int32Array\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var bool = isInt32Array( new Int32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt32Array( [] );\n* // returns false\n*/\nfunction isInt32Array( value ) {\n\treturn (\n\t\t( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt32Array;\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 Int32Array === 'function' ) ? Int32Array : 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 Int32Array === 'function' ) ? Int32Array : 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 isInt32Array from '@stdlib/assert-is-int32array';\nimport INT32_MAX from '@stdlib/constants-int32-max';\nimport INT32_MIN from '@stdlib/constants-int32-min';\nimport GlobalInt32Array from './int32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int32Array` support\n*\n* @example\n* var bool = hasInt32ArraySupport();\n* // returns \n*/\nfunction hasInt32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT32_MIN // wrap around\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 hasInt32ArraySupport;\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* Minimum signed 32-bit integer.\n*\n* @module @stdlib/constants-int32-min\n* @type {integer32}\n*\n* @example\n* import INT32_MIN from '@stdlib/constants-int32-min';\n* // returns -2147483648\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{31})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -2147483648\n*/\nvar INT32_MIN = -2147483648|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MIN;\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 twos-complement 32-bit signed integers 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/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint16\n*\n* @example\n* import ctor from '@stdlib/array-uint16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint16ArraySupport from '@stdlib/assert-has-uint16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\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 hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint16Array\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint16Array( [] );\n* // returns false\n*/\nfunction isUint16Array( value ) {\n\treturn (\n\t\t( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint16Array;\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 Uint16Array === 'function' ) ? Uint16Array : 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 Uint16Array === 'function' ) ? Uint16Array : 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 isUint16Array from '@stdlib/assert-is-uint16array';\nimport UINT16_MAX from '@stdlib/constants-uint16-max';\nimport GlobalUint16Array from './uint16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint16Array` support\n*\n* @example\n* var bool = hasUint16ArraySupport();\n* // returns \n*/\nfunction hasUint16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];\n\t\tarr = new GlobalUint16Array( arr );\n\t\tbool = (\n\t\t\tisUint16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\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 hasUint16ArraySupport;\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 16-bit unsigned integers 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/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int16\n*\n* @example\n* import ctor from '@stdlib/array-int16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt16ArraySupport from '@stdlib/assert-has-int16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt16ArraySupport() ) {\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 hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int16Array\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var bool = isInt16Array( new Int16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt16Array( [] );\n* // returns false\n*/\nfunction isInt16Array( value ) {\n\treturn (\n\t\t( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt16Array;\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 Int16Array === 'function' ) ? Int16Array : 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 Int16Array === 'function' ) ? Int16Array : 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 isInt16Array from '@stdlib/assert-is-int16array';\nimport INT16_MAX from '@stdlib/constants-int16-max';\nimport INT16_MIN from '@stdlib/constants-int16-min';\nimport GlobalInt16Array from './int16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int16Array` support\n*\n* @example\n* var bool = hasInt16ArraySupport();\n* // returns \n*/\nfunction hasInt16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT16_MIN // wrap around\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 hasInt16ArraySupport;\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* Minimum signed 16-bit integer.\n*\n* @module @stdlib/constants-int16-min\n* @type {integer32}\n*\n* @example\n* import INT16_MIN from '@stdlib/constants-int16-min';\n* // returns -32768\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{15})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 1000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -32768\n*/\nvar INT16_MIN = -32768|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MIN;\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 twos-complement 16-bit signed integers 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/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @module @stdlib/array-uint8c\n*\n* @example\n* import ctor from '@stdlib/array-uint8c';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ClampedArraySupport from '@stdlib/assert-has-uint8clampedarray-support'; // eslint-disable-line id-length\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ClampedArraySupport() ) {\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 hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8ClampedArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8ClampedArray( [] );\n* // returns false\n*/\nfunction isUint8ClampedArray( value ) {\n\treturn (\n\t\t( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8ClampedArray]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8ClampedArray;\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 Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : 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 Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : 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 isUint8ClampedArray from '@stdlib/assert-is-uint8clampedarray';\nimport GlobalUint8ClampedArray from './uint8clampedarray.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8ClampedArray` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support\n*\n* @example\n* var bool = hasUint8ClampedArraySupport();\n* // returns \n*/\nfunction hasUint8ClampedArraySupport() { // eslint-disable-line id-length\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8ClampedArray !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );\n\t\tbool = (\n\t\t\tisUint8ClampedArray( arr ) &&\n\t\t\tarr[ 0 ] === 0 && // clamped\n\t\t\tarr[ 1 ] === 0 &&\n\t\t\tarr[ 2 ] === 1 &&\n\t\t\tarr[ 3 ] === 3 && // round to nearest\n\t\t\tarr[ 4 ] === 5 && // round to nearest\n\t\t\tarr[ 5 ] === 255 &&\n\t\t\tarr[ 6 ] === 255 // clamped\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 hasUint8ClampedArraySupport;\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 8-bit unsigned integers in the platform byte order clamped to 0-255.\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/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int8\n*\n* @example\n* import ctor from '@stdlib/array-int8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt8ArraySupport from '@stdlib/assert-has-int8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt8ArraySupport() ) {\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 hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int8Array\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var bool = isInt8Array( new Int8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt8Array( [] );\n* // returns false\n*/\nfunction isInt8Array( value ) {\n\treturn (\n\t\t( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt8Array;\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 Int8Array === 'function' ) ? Int8Array : 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 Int8Array === 'function' ) ? Int8Array : 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 isInt8Array from '@stdlib/assert-is-int8array';\nimport INT8_MAX from '@stdlib/constants-int8-max';\nimport INT8_MIN from '@stdlib/constants-int8-min';\nimport GlobalInt8Array from './int8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int8Array` support\n*\n* @example\n* var bool = hasInt8ArraySupport();\n* // returns \n*/\nfunction hasInt8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT8_MIN // wrap around\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 hasInt8ArraySupport;\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* Minimum signed 8-bit integer.\n*\n* @module @stdlib/constants-int8-min\n* @type {integer32}\n*\n* @example\n* import INT8_MIN from '@stdlib/constants-int8-min';\n* // returns -128\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* -(2^{7})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -128\n*/\nvar INT8_MIN = -128|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MIN;\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 twos-complement 8-bit signed integers 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/**\n* Double-precision floating-point negative infinity.\n*\n* @module @stdlib/constants-float64-ninf\n* @type {number}\n*\n* @example\n* import FLOAT64_NINF from '@stdlib/constants-float64-ninf';\n* // returns -Infinity\n*/\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point negative infinity has the bit sequence\n*\n* ```binarystring\n* 1 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.NEGATIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_NINF = Number.NEGATIVE_INFINITY;\n\n\n// EXPORTS //\n\nexport default FLOAT64_NINF;\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: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward negative infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* @example\n* var v = floor( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = floor( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = floor( NaN );\n* // returns NaN\n*/\nvar floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default floor;\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 floor from '@stdlib/math-base-special-floor';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an integer\n*\n* @example\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( 3.14 );\n* // returns false\n*/\nfunction isInteger( x ) {\n\treturn (floor(x) === x);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport isInt from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a number primitive is an integer value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a number primitive is an integer value\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tvalue < PINF &&\n\t\tvalue > NINF &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having an integer value\n*\n* @example\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having an integer value\n*\n* @example\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 an integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an integer\n*\n* @example\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isInteger( -3.14 );\n* // returns false\n*\n* @example\n* var bool = isInteger( null );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\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 { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\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 nonnegative integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( null );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\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 an integer.\n*\n* @module @stdlib/assert-is-integer\n*\n* @example\n* import isInteger from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isInteger( -3.14 );\n* // returns false\n*\n* bool = isInteger( null );\n* // returns false\n*\n* @example\n* // Use interface to check for integer primitives...\n* import { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*\n* @example\n* // Use interface to check for integer objects...\n* import { isObject as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* bool = isInteger( new Number( 3.0 ) );\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* Test if a value is a nonnegative integer.\n*\n* @module @stdlib/assert-is-nonnegative-integer\n*\n* @example\n* import isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* bool = isNonNegativeInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\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* Maximum length of a generic array.\n*\n* @module @stdlib/constants-array-max-array-length\n*\n* @example\n* import MAX_ARRAY_LENGTH from '@stdlib/constants-array-max-array-length';\n* // returns 4294967295\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a generic array.\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default MAX_ARRAY_LENGTH;\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 isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is an array-like object\n*\n* @example\n* var bool = isArrayLikeObject( [] );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( { 'length': 10 } );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( 'beep' );\n* // returns false\n*/\nfunction isArrayLikeObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayLikeObject;\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* Maximum length of a typed array.\n*\n* @module @stdlib/constants-array-max-typed-array-length\n*\n* @example\n* import MAX_TYPED_ARRAY_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n* // returns 9007199254740991\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a typed array.\n*\n* ```tex\n* 2^{53} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 9007199254740991\n*/\nvar MAX_TYPED_ARRAY_LENGTH = 9007199254740991;\n\n\n// EXPORTS //\n\nexport default MAX_TYPED_ARRAY_LENGTH;\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 isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a collection.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a collection\n*\n* @example\n* var bool = isCollection( [] );\n* // returns true\n*\n* @example\n* var bool = isCollection( {} );\n* // returns false\n*/\nfunction isCollection( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isCollection;\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 hasArrayBuffer = ( typeof ArrayBuffer === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an ArrayBuffer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an ArrayBuffer\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isArrayBuffer( [] );\n* // returns false\n*/\nfunction isArrayBuffer( value ) {\n\treturn (\n\t\t( hasArrayBuffer && value instanceof ArrayBuffer ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object ArrayBuffer]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayBuffer;\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 isArray from '@stdlib/assert-is-array';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an object; e.g., `{}`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an object\n*\n* @example\n* var bool = isObject( {} );\n* // returns true\n*\n* @example\n* var bool = isObject( null );\n* // returns false\n*/\nfunction isObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t!isArray( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObject;\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 an array of strings.\n*\n* @module @stdlib/assert-is-string-array\n*\n* @example\n* import isStringArray from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', 123 ] );\n* // returns false\n*\n* @example\n* import { primitives as isStringArray } from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', new String( 'def' ) ] );\n* // returns false\n*\n* @example\n* import { objects as isStringArray } from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );\n* // returns true\n*\n* bool = isStringArray( [ new String( 'abc' ), 'def' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport arrayfun from '@stdlib/assert-tools-array-function';\nimport isString from '@stdlib/assert-is-string';\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isString.isPrimitive );\nvar isObjectArray = arrayfun( isString.isObject );\n\n\n// MAIN //\n\nvar isStringArray = arrayfun( isString );\nsetReadOnly( isStringArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isStringArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nexport default isStringArray;\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\nvar RE = /./;\n\n\n// EXPORTS //\n\nexport default RE;\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) 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* 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// MAIN //\n\nvar obj = ( typeof self === 'object' ) ? self : null;\n\n\n// EXPORTS //\n\nexport default obj;\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 obj = ( typeof window === 'object' ) ? window : null;\n\n\n// EXPORTS //\n\nexport default obj;\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\nvar obj = ( typeof globalThis === 'object' ) ? globalThis : null; // eslint-disable-line no-undef\n\n\n// EXPORTS //\n\nexport default obj;\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 getGlobal from '@stdlib/utils-global';\n\n\n// MAIN //\n\nvar root = getGlobal();\nvar nodeList = root.document && root.document.childNodes;\n\n\n// EXPORTS //\n\nexport default nodeList;\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 { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport format from '@stdlib/string-format';\nimport getThis from './codegen.js';\nimport Self from './self.js';\nimport Win from './window.js';\nimport GlobalThis from './global_this.js';\n\n\n// MAIN //\n\n/**\n* Returns the global object.\n*\n* ## Notes\n*\n* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.\n*\n* @private\n* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object\n* @throws {TypeError} must provide a boolean\n* @throws {Error} unable to resolve global object\n* @returns {Object} global object\n*\n* @example\n* var g = getGlobal();\n* // returns {...}\n*/\nfunction getGlobal( codegen ) {\n\tif ( arguments.length ) {\n\t\tif ( !isBoolean( codegen ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a boolean. Value: `%s`.', codegen ) );\n\t\t}\n\t\tif ( codegen ) {\n\t\t\treturn getThis();\n\t\t}\n\t\t// Fall through...\n\t}\n\t// Case: 2020 revision of ECMAScript standard\n\tif ( GlobalThis ) {\n\t\treturn GlobalThis;\n\t}\n\t// Case: browsers and web workers\n\tif ( Self ) {\n\t\treturn Self;\n\t}\n\t// Case: browsers\n\tif ( Win ) {\n\t\treturn Win;\n\t}\n\t// Case: unknown\n\tthrow new Error( 'unexpected error. Unable to resolve global object.' );\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the global object using code generation.\n*\n* @private\n* @returns {Object} global object\n*/\nfunction getGlobal() {\n\treturn new Function( 'return this;' )(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\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\nvar typedarray = Int8Array; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default typedarray;\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* Determine a value's type.\n*\n* @module @stdlib/utils-type-of\n*\n* @example\n* import typeOf from '@stdlib/utils-type-of';\n*\n* var str = typeOf( 'a' );\n* // returns 'string'\n*\n* str = typeOf( 5 );\n* // returns 'number'\n*/\n\n// MODULES //\n\nimport usePolyfill from './check.js';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main = ( usePolyfill() ) ? polyfill : builtin;\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 RE from './fixtures/re.js';\nimport nodeList from './fixtures/nodelist.js';\nimport typedarray from './fixtures/typedarray.js';\n\n\n// MAIN //\n\n/**\n* Checks whether a polyfill is needed when using the `typeof` operator.\n*\n* @private\n* @returns {boolean} boolean indicating whether a polyfill is needed\n*/\nfunction check() {\n\tif (\n\t\t// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):\n\t\ttypeof RE === 'function' ||\n\n\t\t// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):\n\t\ttypeof typedarray === 'object' ||\n\n\t\t// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):\n\t\ttypeof nodeList === 'function'\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default check;\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 ctorName from '@stdlib/utils-constructor-name';\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\treturn ctorName( v ).toLowerCase();\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\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 ctorName from '@stdlib/utils-constructor-name';\n\n\n// NOTES //\n\n/*\n* Built-in `typeof` operator behavior:\n*\n* ```text\n* typeof null => 'object'\n* typeof undefined => 'undefined'\n* typeof 'a' => 'string'\n* typeof 5 => 'number'\n* typeof NaN => 'number'\n* typeof true => 'boolean'\n* typeof false => 'boolean'\n* typeof {} => 'object'\n* typeof [] => 'object'\n* typeof function foo(){} => 'function'\n* typeof function* foo(){} => 'object'\n* typeof Symbol() => 'symbol'\n* ```\n*\n*/\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\tvar type;\n\n\t// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):\n\tif ( v === null ) {\n\t\treturn 'null';\n\t}\n\ttype = typeof v;\n\n\t// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.\n\tif ( type === 'object' ) {\n\t\treturn ctorName( v ).toLowerCase();\n\t}\n\treturn type;\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\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 typeOf from '@stdlib/utils-type-of';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a function.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a function\n*\n* @example\n* function beep() {\n* return 'beep';\n* }\n*\n* var bool = isFunction( beep );\n* // returns true\n*/\nfunction isFunction( value ) {\n\t// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.\n\treturn ( typeOf( value ) === 'function' );\n}\n\n\n// EXPORTS //\n\nexport default isFunction;\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* 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// 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 \n*/\nfunction Complex64( real, imag ) {\n\tif ( !( this instanceof Complex64 ) ) {\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', float64ToFloat32( real ) );\n\tsetEnumerableReadOnly( this, 'im', float64ToFloat32( imag ) );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64\n* @readonly\n* @type {string}\n* @default 'Complex64'\n*\n* @example\n* var name = Complex64.name;\n* // returns 'Complex64'\n*/\nsetReadOnly( Complex64, 'name', 'Complex64' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex64.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64.prototype, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 8\n*/\nsetReadOnly( Complex64.prototype, 'byteLength', 8 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex64.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 `Complex64` instance.\n*\n* @name toJSON\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex64.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex64;\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 Complex128 from '@stdlib/complex-float64-ctor';\nimport Complex64 from '@stdlib/complex-float32-ctor';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex number-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex number-like object.\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var x = new Complex128( 4.0, 2.0 );\n* var bool = isComplexLike( x );\n* // returns true\n*\n* x = new Complex64( 4.0, 2.0 );\n* bool = isComplexLike( x );\n* // returns true\n*/\nfunction isComplexLike( value ) {\n\tif ( value instanceof Complex128 || value instanceof Complex64 ) {\n\t\treturn true;\n\t}\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.re === 'number' &&\n\t\ttypeof value.im === 'number'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplexLike;\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 isInteger from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a finite numeric value is an even number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an even number\n*\n* @example\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isEven( -2.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( NaN );\n* // returns false\n*/\nfunction isEven( x ) {\n\treturn isInteger( x/2.0 );\n}\n\n\n// EXPORTS //\n\nexport default isEven;\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 Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.iterator` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.iterator` support\n*\n* @example\n* var bool = hasIteratorSymbolSupport();\n* // returns \n*/\nfunction hasIteratorSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol' &&\n\t\thasOwnProp( Symbol, 'iterator' ) &&\n\t\ttypeof Symbol.iterator === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasIteratorSymbolSupport;\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 = 'Complex64';\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// MODULES //\n\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\n\n\n// MAIN //\n\n/**\n* Iterator symbol.\n*\n* @name IteratorSymbol\n* @constant\n* @type {(symbol|null)}\n*\n* @example\n* function iterator() {\n* var it;\n* var i;\n*\n* i = -1;\n*\n* it = {};\n* it.next = next;\n* it.return = done;\n*\n* if ( IteratorSymbol ) {\n* it[ IteratorSymbol ] = iterator;\n* }\n* return it;\n*\n* function next() {\n* i += 1;\n* return {\n* 'value': i,\n* 'done': false\n* };\n* }\n*\n* function done( value ) {\n* if ( arguments.length === 0 ) {\n* return {\n* 'done': true\n* };\n* }\n* return {\n* 'value': value,\n* 'done': true\n* };\n* }\n* }\n*\n* var obj = iterator();\n*/\nvar IteratorSymbol = ( hasIteratorSymbolSupport() ) ? Symbol.iterator : null;\n\n\n// EXPORTS //\n\nexport default IteratorSymbol;\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 accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnlyAccessor;\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/**\n* Returns the real component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\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/**\n* Returns the imaginary component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\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 isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\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 isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isArray from '@stdlib/assert-is-array';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport isFunction from '@stdlib/assert-is-function';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isEven from '@stdlib/math-base-assert-is-even';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Float32Array from '@stdlib/array-float32';\nimport Complex64 from '@stdlib/complex-float32-ctor';\nimport format from '@stdlib/string-format';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport floor from '@stdlib/math-base-special-floor';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float32Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex64} complex number\n*/\nfunction getComplex64( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); // FIXME: `buf` is what is returned from above, NOT the original value\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = realf( z );\n* // returns 9.0\n*\n* im = imagf( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, getComplex64( buf, i ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex64Array} modified array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.fill( new Complex64( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = realf( value );\n\tim = imagf( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex64Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex64Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 10 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n* // returns -1\n*/\nsetReadOnly( Complex64Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex64( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( v, i ) {\n* return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2\n*\n* var im = imagf( z );\n* // returns -2\n*/\nsetReadOnly( Complex64Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex64( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = realf( v );\n\t\t\toutbuf[ (2*i)+1 ] = imagf( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import caddf from '@stdlib/complex-float32-base-add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import caddf from '@stdlib/complex-float32-base-add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = realf( tmp[i] );\n\t\tbuf[ j+1 ] = imagf( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + (begin*BYTES_PER_ELEMENT);\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex64Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = realf( v );\n* // returns 1.0\n*\n* var im = imagf( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = realf( v );\n* // returns 2.0\n*\n* im = imagf( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex64( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex64Array} new typed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 4.0\n*\n* var im = imagf( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex64Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = realf( value );\n\tbuf[ (2*index)+1 ] = imagf( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex64Array;\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 isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\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* Returns the real component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\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* Returns the imaginary component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\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 isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport format from '@stdlib/string-format';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\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 isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isArray from '@stdlib/assert-is-array';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport isString from '@stdlib/assert-is-string';\nimport isFunction from '@stdlib/assert-is-function';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isEven from '@stdlib/math-base-assert-is-even';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Float64Array from '@stdlib/array-float64';\nimport Complex128 from '@stdlib/complex-float64-ctor';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\nimport floor from '@stdlib/math-base-special-floor';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport format from '@stdlib/string-format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float64Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex128} complex number\n*/\nfunction getComplex128( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = real( z );\n* // returns 9.0\n*\n* im = imag( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex128Array} modified array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.fill( new Complex128( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = real( value );\n\tim = imag( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex128Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex128Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex128( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex128( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex128( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex128( 4.0, -4.0 ), -3 );\n* // returns 3\n*/\nsetReadOnly( Complex128Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex128( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function scale( v, i ) {\n* return new Complex128( 2.0*real( v ), 2.0*imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns -2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex128( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = real( v );\n\t\t\toutbuf[ (2*i)+1 ] = imag( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import cadd from '@stdlib/complex-float64-base-add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import cadd from '@stdlib/complex-float64-base-add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = real( tmp[i] );\n\t\tbuf[ j+1 ] = imag( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex128Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = real( v );\n* // returns 1.0\n*\n* var im = imag( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = real( v );\n* // returns 2.0\n*\n* im = imag( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex128( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex128Array} new typed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex128( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 4.0\n*\n* var im = imag( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex128Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = real( value );\n\tbuf[ (2*index)+1 ] = imag( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex128Array;\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 isComplexLike from '@stdlib/assert-is-complex-like';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( Boolean( v.value ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\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 isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport format from '@stdlib/string-format';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isFunction from '@stdlib/assert-is-function';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Boolean from '@stdlib/boolean-ctor';\nimport getter from '@stdlib/array-base-getter';\nimport floor from '@stdlib/math-base-special-floor';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport format from '@stdlib/string-format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Uint8Array.BYTES_PER_ELEMENT;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a `BooleanArray`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `BooleanArray`\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'BooleanArray' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a boolean typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean typed array constructor\n*/\nfunction isBooleanArrayConstructor( value ) {\n\treturn ( value === BooleanArray );\n}\n\n\n// MAIN //\n\n/**\n* Boolean array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new BooleanArray( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new BooleanArray( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 16\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 8\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new BooleanArray( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction BooleanArray() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof BooleanArray) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new BooleanArray();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new BooleanArray( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new BooleanArray( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new BooleanArray( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Uint8Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ 0 ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new Uint8Array( arg.length ), arg );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( fromIterator( buf ) );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new Uint8Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var nbytes = BooleanArray.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof BooleanArray\n* @readonly\n* @type {string}\n* @default 'BooleanArray'\n*\n* @example\n* var str = BooleanArray.name;\n* // returns 'BooleanArray'\n*/\nsetReadOnly( BooleanArray, 'name', 'BooleanArray' );\n\n/**\n* Creates a new boolean array from an array-like object or an iterable.\n*\n* @name from\n* @memberof BooleanArray\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.from( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return !v;\n* }\n*\n* var arr = BooleanArray.from( [ true, false ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( BooleanArray, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf[ i ] = Boolean( clbk.call( thisArg, get( src, i ), i ) );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new boolean array from a variable number of arguments.\n*\n* @name of\n* @memberof BooleanArray\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.of( true, true, true, true );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( BooleanArray, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide an integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.at( 0 );\n* // returns true\n*\n* v = arr.at( -1 );\n* // returns true\n*\n* v = arr.at( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'at', function at( idx ) {\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tif ( idx < 0 ) {\n\t\tidx += len;\n\t}\n\tif ( idx < 0 || idx >= len ) {\n\t\treturn;\n\t}\n\treturn Boolean( buf[ idx ] );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray.prototype, 'BYTES_PER_ELEMENT', BooleanArray.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 4 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n* arr.set( true, 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* var v = arr.get( 2 );\n* // returns true\n*\n* v = arr.get( 3 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target, start );\n\t} else {\n\t\tthis._buffer.copyWithin( target, start, arguments[2] );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var it = arr.entries();\n*\n* var v = it.next().value;\n* // returns [ 0, true ]\n*\n* v = it.next().value;\n* // returns [ 1, false ]\n*\n* v = it.next().value;\n* // returns [ 2, true ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, Boolean( buf[ i ] ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.fill( true, 1 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar val;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tif ( value ) {\n\t\tval = 1;\n\t} else {\n\t\tval = 0;\n\t}\n\tfor ( i = start; i < end; i++ ) {\n\t\tbuf[ i ] = val;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* function predicate( v ) {\n* return ( v === true );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 2\n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\tout.push( v );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.find( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findIndex( predicate );\n* // returns 0\n*/\nsetReadOnly( BooleanArray.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLast( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLastIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( BooleanArray.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tfcn.call( thisArg, Boolean( buf[ i ] ), i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'get', function get( idx ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn Boolean( this._buffer[ idx ] );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a value\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var bool = arr.includes( true );\n* // returns true\n*\n* bool = arr.includes( false, 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.indexOf( true );\n* // returns 0\n*\n* idx = arr.indexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.indexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.join();\n* // returns 'true,false,true'\n*\n* str = arr.join( '|' );\n* // returns 'true|false|true'\n*/\nsetReadOnly( BooleanArray.prototype, 'join', function join( separator ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isString( separator ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t\t}\n\t} else {\n\t\tseparator = ',';\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( separator );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.lastIndexOf( true );\n* // returns 4\n*\n* idx = arr.lastIndexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} new boolean array\n*\n* @example\n* function invert( v ) {\n* return !v;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.map( invert );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns false\n*\n* z = out.get( 1 );\n* // returns true\n*\n* z = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be a function. Value: `%s`.', fcn );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\toutbuf[ i ] = Boolean( fcn.call( thisArg, Boolean( buf[ i ] ), i, this ) );\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduce( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ 0 ] );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduceRight( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len - 1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ len-1 ] );\n\t\ti = len - 2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ i ];\n\t\tbuf[ i ] = buf[ j ];\n\t\tbuf[ j ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(Collection|BooleanArray|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tif ( isBooleanArray( value ) ) {\n\t\t\tsbuf = value._buffer; // eslint-disable-line no-underscore-dangle\n\t\t} else {\n\t\t\tsbuf = value;\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Uint8Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf[ idx ] = ( sbuf[ i ] ) ? 1 : 0;\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf[ idx ] = ( value ) ? 1 : 0;\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be integer\n* @throws {TypeError} second argument must be integer\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var bool = out.get( 0 );\n* // returns true\n*\n* bool = out.get( len-1 );\n* // returns true\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* bool = out.get( 0 );\n* // returns false\n*\n* bool = out.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'slice', function slice( begin, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar len;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin < end ) {\n\t\toutlen = end - begin;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\toutbuf[ i ] = buf[ i+begin ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( false, 0 );\n* arr.set( true, 1 );\n* arr.set( false, 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.sort( compare );\n*\n* var v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'sort', function sort( compareFcn ) {\n\tvar buf;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length === 0 ) {\n\t\tbuf.sort();\n\t\treturn this;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf.sort( compare );\n\treturn this;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {BooleanArray} subarray\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var bool = subarr.get( 0 );\n* // returns true\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* bool = subarr.get( 0 );\n* // returns false\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toLocaleString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( Boolean( buf[ i ] ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ len - i - 1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*\n* v = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ i ];\n\t}\n\tif ( arguments.length === 0 ) {\n\t\toutbuf.sort();\n\t\treturn out;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\toutbuf.sort( compare );\n\treturn out;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns true\n*\n* v = iter.next().value;\n* // returns false\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': Boolean( buf[ i ] ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {boolean} value - new value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a boolean\n* @returns {BooleanArray} new typed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.with( 0, false );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tif ( value ) {\n\t\tbuf[ index ] = 1;\n\t} else {\n\t\tbuf[ index ] = 0;\n\t}\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default BooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Fills an output array with \"boolean\" values.\n*\n* @private\n* @param {Uint8Array} buf - output array\n* @param {Array} arr - input array\n* @returns {Uint8Array} output array\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar i;\n\n\tlen = arr.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tbuf[ i ] = Boolean( arr[ i ] );\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( Boolean( clbk.call( thisArg, v.value, i ) ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array-float64';\nimport Float32Array from '@stdlib/array-float32';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Int32Array from '@stdlib/array-int32';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Int16Array from '@stdlib/array-int16';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Int8Array from '@stdlib/array-int8';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array,\n\tBooleanArray\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128',\n\t'bool'\n];\n\n\n// EXPORTS //\n\nexport default DTYPES;\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 isBuffer from '@stdlib/assert-is-buffer';\nimport isArray from '@stdlib/assert-is-array';\nimport constructorName from '@stdlib/utils-constructor-name';\nimport ctor2dtype from './ctor2dtype.js';\nimport CTORS from './ctors.js';\nimport DTYPES from './dtypes.js';\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\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 isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport getter from '@stdlib/array-base-getter';\nimport setter from '@stdlib/array-base-setter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport accessorSetter from '@stdlib/array-base-accessor-setter';\nimport dtype from '@stdlib/array-dtype';\n\n\n// MAIN //\n\n/**\n* Converts an array-like to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding array meta data to ensure that internal functions operating on arrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **data**: reference to the input array.\n* - **dtype**: array data type.\n* - **accessorProtocol**: `boolean` indicating whether the input array uses accessors for getting and setting elements.\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.\n*\n* @param {Collection} x - array-like object\n* @returns {Object} object containing array meta data\n*\n* @example\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\nfunction arraylike2object( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn {\n\t\t\t'data': x,\n\t\t\t'dtype': dt,\n\t\t\t'accessorProtocol': true,\n\t\t\t'accessors': [\n\t\t\t\taccessorGetter( dt ),\n\t\t\t\taccessorSetter( dt )\n\t\t\t]\n\t\t};\n\t}\n\treturn {\n\t\t'data': x,\n\t\t'dtype': dt,\n\t\t'accessorProtocol': false,\n\t\t'accessors': [\n\t\t\tgetter( dt ),\n\t\t\tsetter( dt )\n\t\t]\n\t};\n}\n\n\n// EXPORTS //\n\nexport default arraylike2object;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gscal( 3, 5.0, arraylike2object( toAccessorArray( x ) ), 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction gscal( N, alpha, x, stride, offset ) {\n\tvar xbuf;\n\tvar xget;\n\tvar xset;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\txbuf = x.data;\n\txget = x.accessors[ 0 ];\n\txset = x.accessors[ 1 ];\n\n\tix = offset;\n\tif ( stride === 0 ) {\n\t\txset( xbuf, ix, xget( xbuf, ix ) * N * alpha );\n\t\treturn x;\n\t}\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\txset( xbuf, ix, xget( xbuf, ix ) * alpha );\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\txset( xbuf, ix, xget( xbuf, ix ) * alpha );\n\t\t\txset( xbuf, ix+1, xget( xbuf, ix+1 ) * alpha );\n\t\t\txset( xbuf, ix+2, xget( xbuf, ix+2 ) * alpha );\n\t\t\txset( xbuf, ix+3, xget( xbuf, ix+3 ) * alpha );\n\t\t\txset( xbuf, ix+4, xget( xbuf, ix+4 ) * alpha );\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\txset( xbuf, ix, xget( xbuf, ix ) * alpha );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gscal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector by a scalar constant using alternative indexing semantics.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gscal( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction gscal( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, alpha, o, stride, offset );\n\t\treturn x;\n\t}\n\n\tix = offset;\n\tif ( stride === 0 ) {\n\t\tx[ ix ] *= alpha * N;\n\t\treturn x;\n\t}\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] *= alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] *= alpha;\n\t\t\tx[ ix+1 ] *= alpha;\n\t\t\tx[ ix+2 ] *= alpha;\n\t\t\tx[ ix+3 ] *= alpha;\n\t\t\tx[ ix+4 ] *= alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] *= alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gscal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 stride2offset from '@stdlib/strided-base-stride2offset';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\n/**\n* Multiplies a vector by a scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar constant\n* @param {NumericArray} x - input array\n* @param {PositiveInteger} stride - stride length\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\nfunction gscal( N, alpha, x, stride ) {\n\treturn ndarray( N, alpha, x, stride, stride2offset( N, stride ) );\n}\n\n\n// EXPORTS //\n\nexport default gscal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a strided array.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {integer} stride - index increment\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var offset = stride2offset( 10, -10 );\n* // returns 90\n*/\nfunction stride2offset( N, stride ) {\n\tif ( stride > 0 ) {\n\t\treturn 0;\n\t}\n\treturn ( 1 - N ) * stride;\n}\n\n\n// EXPORTS //\n\nexport default stride2offset;\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* Generates a linearly spaced numeric array whose elements increment by 1 starting from zero.\n*\n* @param {number} n - number of elements\n* @returns {Array} linearly spaced numeric array\n*\n* @example\n* var arr = zeroTo( 6 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*/\nfunction zeroTo( n ) {\n\tvar arr;\n\tvar i;\n\n\tarr = [];\n\tif ( n <= 0 ) {\n\t\treturn arr;\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tarr.push( i );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nexport default zeroTo;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\n\n\n// FUNCTIONS //\n\n/**\n* Fills an indexed array with linearly spaced numeric elements which increment by 1 starting from zero.\n*\n* @private\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* var arr = indexed( out, 1, 0 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*\n* @example\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* var arr = indexed( out, -1, out.length-1 );\n* // returns [ 5, 4, 3, 2, 1, 0 ]\n*/\nfunction indexed( out, stride, offset ) {\n\tvar v;\n\tvar i;\n\n\ti = offset;\n\tv = 0;\n\twhile ( i >= 0 && i < out.length ) {\n\t\tout[ i ] = v;\n\t\ti += stride;\n\t\tv += 1;\n\t}\n\treturn out;\n}\n\n/**\n* Fills a complex number array with linearly spaced numeric elements which increment by 1 starting from zero.\n*\n* @private\n* @param {(Complex128Array|Complex64Array)} out - output complex number array\n* @param {(Float64Array|Float32Array)} data - output array data\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {(Complex128Array|Complex64Array)} output array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n* import reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\n*\n* var out = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );\n* // returns \n*\n* var data = reinterpret128( out, 0 );\n* // returns [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]\n*\n* var arr = complex( out, data, 1, 0 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*\n* data = reinterpret128( out, 0 );\n* returns [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0 ]\n*/\nfunction complex( out, data, stride, offset ) {\n\tvar v;\n\tvar s;\n\tvar i;\n\n\ts = stride * 2;\n\ti = offset * 2;\n\tv = 0.0;\n\twhile ( i >= 0 && i < data.length ) {\n\t\tdata[ i ] = v; // real component\n\t\tdata[ i+1 ] = 0.0; // imaginary component\n\t\ti += s;\n\t\tv += 1.0;\n\t}\n\treturn out;\n}\n\n/**\n* Fills an accessor array with linearly spaced numeric elements which increment by 1 starting from zero.\n*\n* @private\n* @param {Object} out - output array object\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n\n* var out = toAccessorArray( [ 0, 0, 0, 0, 0, 0 ] );\n* var arr = accessors( arraylike2object( out ), 1, 0 );\n*\n* var bool = ( arr === out );\n* // returns true\n*\n* var v = out.get( 0 );\n* // returns 0\n*\n* v = out.get( out.length-1 );\n* // returns 5\n*/\nfunction accessors( out, stride, offset ) {\n\tvar data;\n\tvar set;\n\tvar v;\n\tvar i;\n\n\tdata = out.data;\n\tset = out.accessors[ 1 ];\n\n\ti = offset;\n\tv = 0;\n\twhile ( i >= 0 && i < data.length ) {\n\t\tset( data, i, v );\n\t\ti += stride;\n\t\tv += 1;\n\t}\n\treturn data;\n}\n\n\n// MAIN //\n\n/**\n* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.\n*\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* var arr = assign( out, 1, 0 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*\n* @example\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* var arr = assign( out, -1, out.length-1 );\n* // returns [ 5, 4, 3, 2, 1, 0 ]\n*/\nfunction assign( out, stride, offset ) {\n\tvar obj = arraylike2object( out );\n\tif ( obj.accessorProtocol ) {\n\t\t// If provided a complex number array, reinterpret as a real typed array and only set the real components...\n\t\tif ( obj.dtype === 'complex128' ) {\n\t\t\treturn complex( out, reinterpret128( out, 0 ), stride, offset );\n\t\t}\n\t\tif ( obj.dtype === 'complex64' ) {\n\t\t\treturn complex( out, reinterpret64( out, 0 ), stride, offset );\n\t\t}\n\t\treturn accessors( obj, stride, offset );\n\t}\n\treturn indexed( out, stride, offset );\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport copy from '@stdlib/array-base-copy-indexed';\nimport take from '@stdlib/array-base-take-indexed';\nimport sort2ins from './sort2ins.js';\n\n\n// MAIN //\n\n/**\n* Reorders ndarray dimensions and associated strides for loop interchange.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **sh**: dimensions sorted in loop order.\n* - **sx**: ndarray strides sorted in loop order.\n* - **idx**: dimension indices sorted in loop order.\n*\n* @param {NonNegativeIntegerArray} sh - array dimensions\n* @param {IntegerArray} sx - array stride lengths\n* @returns {Object} loop interchange data\n*\n* @example\n* var sh = [ 2, 3, 4 ];\n*\n* var sx = [ 12, 4, 1 ]; // row-major\n*\n* var o = loopOrder( sh, sx );\n* // returns {...}\n*\n* var ssh = o.sh;\n* // returns [ 4, 3, 2 ]\n*\n* var ssx = o.sx;\n* // returns [ 1, 4, 12 ]\n*\n* var idx = o.idx;\n* // returns [ 2, 1, 0 ]\n*/\nfunction loopOrder( sh, sx ) {\n\tvar idx;\n\n\t// Initialize a loop interchange index array for generating a loop order permutation:\n\tidx = zeroTo( sh.length );\n\n\t// Sort the array strides in increasing order (of magnitude):\n\tsx = copy( sx );\n\tsort2ins( sx, idx );\n\n\t// Permute the shape based on the sorted array strides:\n\tsh = take( sh, idx );\n\n\treturn {\n\t\t'sh': sh,\n\t\t'sx': sx,\n\t\t'idx': idx\n\t};\n}\n\n\n// EXPORTS //\n\nexport default loopOrder;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Simultaneously sorts two arrays based on the sort order of the first array using insertion sort.\n*\n* ## Notes\n*\n* - The first array is sorted in increasing order according to absolute value.\n* - The algorithm has space complexity `O(1)` and worst case time complexity `O(N^2)`.\n* - The algorithm is efficient for small arrays (typically `N <= 20`) and is particularly efficient for sorting arrays which are already substantially sorted.\n* - The algorithm is **stable**, meaning that the algorithm does **not** change the order of array elements which are equal or equivalent.\n* - The input arrays are sorted in-place (i.e., the input arrays are mutated).\n*\n* @private\n* @param {Array} x - first array\n* @param {Array} y - second array\n* @returns {void}\n*\n* @example\n* var x = [ -4, -2, 3, 1 ];\n* var y = [ 0, 1, 2, 3 ];\n*\n* sort2ins( x, y );\n*\n* console.log( x );\n* // => [ 1, -2, 3, -4 ]\n*\n* console.log( y );\n* // => [ 3, 1, 2, 0 ]\n*/\nfunction sort2ins( x, y ) {\n\tvar avx;\n\tvar aux;\n\tvar ix;\n\tvar iy;\n\tvar jx;\n\tvar jy;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tix = 1;\n\tiy = 1;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < x.length; i++ ) {\n\t\tvx = x[ ix ];\n\t\tavx = ( vx < 0 ) ? -vx : vx;\n\n\t\tvy = y[ iy ];\n\n\t\tjx = ix - 1;\n\t\tjy = iy - 1;\n\n\t\t// Shift all larger values to the left of the current element to the right...\n\t\twhile ( jx >= 0 ) {\n\t\t\tux = x[ jx ];\n\t\t\taux = ( ux < 0 ) ? -ux : ux;\n\t\t\tif ( aux <= avx ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tx[ jx+1 ] = ux;\n\t\t\ty[ jy+1 ] = y[ jy ];\n\t\t\tjx -= 1;\n\t\t\tjy -= 1;\n\t\t}\n\t\tx[ jx+1 ] = vx;\n\t\ty[ jy+1 ] = vy;\n\t\tix += 1;\n\t\tiy += 1;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default sort2ins;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Takes elements from an indexed array.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} indices - list of indices\n* @returns {Array} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n* var indices = [ 3, 1, 2, 0 ];\n*\n* var y = take( x, indices );\n* // returns [ 4, 2, 3, 1 ]\n*/\nfunction take( x, indices ) {\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < indices.length; i++ ) {\n\t\tout.push( x[ indices[ i ] ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default take;\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 isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\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 { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\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 positive integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a positive integer\n*\n* @example\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( 0.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( null );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\treturn Object.keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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* Multiply a vector by a scalar constant.\n*\n* @module @stdlib/blas-base-gscal\n*\n* @example\n* import gscal from '@stdlib/blas-base-gscal';\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*\n* @example\n* import gscal from '@stdlib/blas-base-gscal';\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\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* Generate a linearly spaced numeric array whose elements increment by 1 starting from zero.\n*\n* @module @stdlib/array-base-zero-to\n*\n* @example\n* import zeroTo from '@stdlib/array-base-zero-to';\n*\n* var arr = zeroTo( 6 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*\n* @example\n* import zeroTo from '@stdlib/array-base-zero-to';\n*\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n* var arr = zeroTo.assign( out, 1, 0 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a positive integer.\n*\n* @module @stdlib/assert-is-positive-integer\n*\n* @example\n* import isPositiveInteger from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* bool = isPositiveInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\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// MAIN //\n\nvar bool = ( typeof Object.keys !== 'undefined' );\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// MODULES //\n\nimport isArguments from './main.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment returns the expected internal class of the `arguments` object.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment behaves as expected\n*\n* @example\n* var bool = detect();\n* // returns \n*/\nfunction detect() {\n\treturn isArguments( arguments );\n}\n\n\n// MAIN //\n\nbool = detect();\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// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn ( nativeClass( value ) === '[object Arguments]' );\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\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 if a double-precision floating-point numeric value is `NaN`.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 7.0 );\n* // returns false\n*/\nfunction isnan( x ) {\n\treturn ( x !== x );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\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 isNan from '@stdlib/math-base-assert-is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a `NaN` number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `NaN` number primitive\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\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 { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isNan from '@stdlib/math-base-assert-is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a value of `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a value of `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\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 `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( null );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\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 `NaN`.\n*\n* @module @stdlib/assert-is-nan\n*\n* @example\n* import isnan from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isnan } from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\n* // returns false\n*\n* @example\n* import { isObject as isnan } from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\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// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @private\n* @name isEnumerableProperty\n* @type {Function}\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty.call( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty.call( beep, 'hasOwnProperty' );\n* // returns false\n*/\nvar isEnumerableProperty = Object.prototype.propertyIsEnumerable;\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\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 isEnum from './native.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment has a bug where String indices are not detected as \"enumerable\" properties. Observed in Node v0.10.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment has the bug\n*/\nfunction detect() {\n\treturn !isEnum.call( 'beep', '0' );\n}\n\n\n// MAIN //\n\nbool = detect();\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// MODULES //\n\nimport isString from '@stdlib/assert-is-string';\nimport { isPrimitive as isnan } from '@stdlib/assert-is-nan';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isEnum from './native.js';\nimport hasStringEnumBug from './has_string_enumerability_bug.js';\n\n\n// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );\n* // returns false\n*/\nfunction isEnumerableProperty( value, property ) {\n\tvar bool;\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\tbool = isEnum.call( value, property );\n\tif ( !bool && hasStringEnumBug && isString( value ) ) {\n\t\t// Note: we only check for indices, as properties attached to a `String` object are properly detected as enumerable above.\n\t\tproperty = +property;\n\t\treturn (\n\t\t\t!isnan( property ) &&\n\t\t\tisInteger( property ) &&\n\t\t\tproperty >= 0 &&\n\t\t\tproperty < value.length\n\t\t);\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\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 an `arguments` object.\n*\n* @module @stdlib/assert-is-arguments\n*\n* @example\n* import isArguments from '@stdlib/assert-is-arguments';\n*\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* bool = isArguments( [] );\n* // returns false\n*/\n\n// MODULES //\n\nimport hasArgumentsClass from './detect.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar isArguments;\nif ( hasArgumentsClass ) {\n\tisArguments = main;\n} else {\n\tisArguments = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\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 isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\nimport isArray from '@stdlib/assert-is-array';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-uint32-max';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object' &&\n\t\t!isArray( value ) &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH &&\n\t\thasOwnProp( value, 'callee' ) &&\n\t\t!isEnumerableProperty( value, 'callee' )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\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 isArguments from '@stdlib/assert-is-arguments';\nimport builtin from './builtin.js';\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tif ( isArguments( value ) ) {\n\t\treturn builtin( slice.call( value ) );\n\t}\n\treturn builtin( value );\n}\n\n\n// EXPORTS //\n\nexport default keys;\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 isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\nimport noop from '@stdlib/utils-noop';\n\n\n// MAIN //\n\n// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...\nvar bool = isEnumerableProperty( noop, 'prototype' );\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/**\n* No operation.\n*\n* @example\n* noop();\n* // ...does nothing.\n*/\nfunction noop() {\n\t// Empty function...\n}\n\n\n// EXPORTS //\n\nexport default noop;\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 isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\n\n\n// VARIABLES //\n\nvar obj = {\n\t'toString': null\n};\n\n\n// MAIN //\n\n// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...\nvar bool = !isEnumerableProperty( obj, 'toString' );\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// MODULES //\n\nimport isnan from '@stdlib/assert-is-nan';\nimport isCollection from '@stdlib/assert-is-collection';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @param {ArrayLike} arr - array-like object\n* @param {*} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)\n* @throws {TypeError} must provide an array-like object\n* @throws {TypeError} third argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 5 );\n* // returns -1\n*\n* @example\n* // Using a `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* @example\n* // `fromIndex` which exceeds `array` length:\n* var arr = [ 1, 2, 3, 4, 2, 5 ];\n* var idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* @example\n* // Negative `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* var idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* @example\n* // Negative `fromIndex` exceeding input `array` length:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* @example\n* // Array-like objects:\n* var str = 'bebop';\n* var idx = indexOf( str, 'o' );\n* // returns 3\n*/\nfunction indexOf( arr, searchElement, fromIndex ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( len === 0 ) {\n\t\treturn -1;\n\t}\n\tif ( arguments.length === 3 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= 0 ) {\n\t\t\tif ( fromIndex >= len ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti = fromIndex;\n\t\t} else {\n\t\t\ti = len + fromIndex;\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\ti = 0;\n\t}\n\t// Check for `NaN`...\n\tif ( isnan( searchElement ) ) {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( isnan( arr[i] ) ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( arr[ i ] === searchElement ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// EXPORTS //\n\nexport default indexOf;\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 whether a value equals the prototype of its constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction isConstructorPrototype( value ) {\n\treturn ( value.constructor && value.constructor.prototype === value );\n}\n\n\n// EXPORTS //\n\nexport default isConstructorPrototype;\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 hasArgumentsBug from './has_arguments_bug.js';\nimport HAS_BUILTIN from './has_builtin.js';\nimport builtin from './builtin.js';\nimport wrapper from './builtin_wrapper.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @name keys\n* @type {Function}\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nvar keys;\nif ( HAS_BUILTIN ) {\n\tif ( hasArgumentsBug() ) {\n\t\tkeys = wrapper;\n\t} else {\n\t\tkeys = builtin;\n\t}\n} else {\n\tkeys = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default keys;\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 w = ( typeof window === 'undefined' ) ? void 0 : window;\n\n\n// EXPORTS //\n\nexport default w;\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 indexOf from '@stdlib/utils-index-of';\nimport typeOf from '@stdlib/utils-type-of';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport EXCLUDED_KEYS from './excluded_keys.json';\nimport win from './window.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).\n*\n* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment is buggy\n*/\nfunction check() {\n\tvar k;\n\tif ( typeOf( win ) === 'undefined' ) {\n\t\treturn false;\n\t}\n\tfor ( k in win ) { // eslint-disable-line guard-for-in\n\t\ttry {\n\t\t\tif (\n\t\t\t\tindexOf( EXCLUDED_KEYS, k ) === -1 &&\n\t\t\t\thasOwnProp( win, k ) &&\n\t\t\t\twin[ k ] !== null &&\n\t\t\t\ttypeOf( win[ k ] ) === 'object'\n\t\t\t) {\n\t\t\t\tisConstructorPrototype( win[ k ] );\n\t\t\t}\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\nbool = check();\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// MAIN //\n\nvar bool = ( typeof window !== 'undefined' );\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// MODULES //\n\nimport keys from './builtin.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests the built-in `Object.keys()` implementation when provided `arguments`.\n*\n* @private\n* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys\n*/\nfunction test() {\n\treturn ( keys( arguments ) || '' ).length !== 2;\n}\n\n\n// MAIN //\n\n/**\n* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.\n*\n* ## Notes\n*\n* - Safari 5.0 does **not** support `arguments` as an input value.\n*\n* @private\n* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`\n*/\nfunction check() {\n\treturn test( 1, 2 );\n}\n\n\n// EXPORTS //\n\nexport default check;\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 isObjectLike from '@stdlib/assert-is-object-like';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport isArguments from '@stdlib/assert-is-arguments';\nimport HAS_ENUM_PROTO_BUG from './has_enumerable_prototype_bug.js';\nimport HAS_NON_ENUM_PROPS_BUG from './has_non_enumerable_properties_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype_wrapper.js';\nimport NON_ENUMERABLE from './non_enumerable.json';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tvar skipConstructor;\n\tvar skipPrototype;\n\tvar isFcn;\n\tvar out;\n\tvar k;\n\tvar p;\n\tvar i;\n\n\tout = [];\n\tif ( isArguments( value ) ) {\n\t\t// Account for environments which treat `arguments` differently...\n\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\tout.push( i.toString() );\n\t\t}\n\t\t// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).\n\t\treturn out;\n\t}\n\tif ( typeof value === 'string' ) {\n\t\t// Account for environments which do not treat string character indices as \"own\" properties...\n\t\tif ( value.length > 0 && !hasOwnProp( value, '0' ) ) {\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\tout.push( i.toString() );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tisFcn = ( typeof value === 'function' );\n\t\tif ( isFcn === false && !isObjectLike( value ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tskipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );\n\t}\n\tfor ( k in value ) {\n\t\tif ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {\n\t\t\tout.push( String( k ) );\n\t\t}\n\t}\n\tif ( HAS_NON_ENUM_PROPS_BUG ) {\n\t\tskipConstructor = isConstructorPrototype( value );\n\t\tfor ( i = 0; i < NON_ENUMERABLE.length; i++ ) {\n\t\t\tp = NON_ENUMERABLE[ i ];\n\t\t\tif ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {\n\t\t\t\tout.push( String( p ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default keys;\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 hasAutomationEqualityBug from './has_automation_equality_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport HAS_WINDOW from './has_window.js';\n\n\n// MAIN //\n\n/**\n* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction wrapper( value ) {\n\tif ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {\n\t\treturn isConstructorPrototype( value );\n\t}\n\ttry {\n\t\treturn isConstructorPrototype( value );\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrapper;\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 isFunction from '@stdlib/assert-is-function';\nimport builtin from './native.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar getProto;\nif ( isFunction( Object.getPrototypeOf ) ) {\n\tgetProto = builtin;\n} else {\n\tgetProto = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\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 an object.\n*\n* @name Object\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {Object} object\n*\n* @example\n* var o = new Object( null );\n* // returns {}\n*\n* @example\n* var o = new Object( 5.0 );\n* // returns \n*\n* @example\n* var o = new Object( 'beep' );\n* // returns \n*\n* @example\n* var o1 = {};\n*\n* var o2 = new Object( o1 );\n* // returns {}\n*\n* var bool = ( o1 === o2 );\n* // returns true\n*/\nvar Obj = Object; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Obj;\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 getProto = Object.getPrototypeOf;\n\n\n// EXPORTS //\n\nexport default getProto;\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';\nimport Object from '@stdlib/object-ctor';\nimport getProto from './proto.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {(Object|null)} prototype\n*/\nfunction getPrototypeOf( obj ) {\n\tvar proto = getProto( obj );\n\tif ( proto || proto === null ) {\n\t\treturn proto;\n\t}\n\tif ( nativeClass( obj.constructor ) === '[object Function]' ) {\n\t\t// May break if the constructor has been tampered with...\n\t\treturn obj.constructor.prototype;\n\t}\n\tif ( obj instanceof Object ) {\n\t\treturn Object.prototype;\n\t}\n\t// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\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* Returns the value of the `__proto__` property.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {*} value of `__proto__` property\n*/\nfunction getProto( obj ) {\n\t// eslint-disable-next-line no-proto\n\treturn obj.__proto__;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\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 isObject from '@stdlib/assert-is-object';\nimport isFunction from '@stdlib/assert-is-function';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar objectPrototype = Object.prototype;\n\n\n// FUNCTIONS //\n\n/**\n* Tests that an object only has own properties.\n*\n* @private\n* @param {Object} obj - value to test\n* @returns {boolean} boolean indicating if an object only has own properties\n*/\nfunction ownProps( obj ) {\n\tvar key;\n\n\t// NOTE: possibility of perf boost if key enumeration order is known (see http://stackoverflow.com/questions/18531624/isplainobject-thing).\n\tfor ( key in obj ) {\n\t\tif ( !hasOwnProp( obj, key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// MAIN //\n\n/**\n* Tests if a value is a plain object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a plain object\n*\n* @example\n* var bool = isPlainObject( {} );\n* // returns true\n*\n* @example\n* var bool = isPlainObject( null );\n* // returns false\n*/\nfunction isPlainObject( value ) {\n\tvar proto;\n\n\t// Screen for obvious non-objects...\n\tif ( !isObject( value ) ) {\n\t\treturn false;\n\t}\n\t// Objects with no prototype (e.g., `Object.create( null )`) are plain...\n\tproto = getPrototypeOf( value );\n\tif ( !proto ) {\n\t\treturn true;\n\t}\n\t// Objects having a prototype are plain if and only if they are constructed with a global `Object` function and the prototype points to the prototype of a plain object...\n\treturn (\n\t\t// Cannot have own `constructor` property:\n\t\t!hasOwnProp( value, 'constructor' ) &&\n\n\t\t// Prototype `constructor` property must be a function (see also https://bugs.jquery.com/ticket/9897 and http://stackoverflow.com/questions/18531624/isplainobject-thing):\n\t\thasOwnProp( proto, 'constructor' ) &&\n\t\tisFunction( proto.constructor ) &&\n\t\tnativeClass( proto.constructor ) === '[object Function]' &&\n\n\t\t// Test for object-specific method:\n\t\thasOwnProp( proto, 'isPrototypeOf' ) &&\n\t\tisFunction( proto.isPrototypeOf ) &&\n\n\t\t(\n\t\t\t// Test if the prototype matches the global `Object` prototype (same realm):\n\t\t\tproto === objectPrototype ||\n\n\t\t\t// Test that all properties are own properties (cross-realm; *most* likely a plain object):\n\t\t\townProps( value )\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPlainObject;\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 Object from '@stdlib/object-ctor';\nimport getProto from './detect.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @param {*} value - input value\n* @returns {(Object|null)} prototype\n*\n* @example\n* var proto = getPrototypeOf( {} );\n* // returns {}\n*/\nfunction getPrototypeOf( value ) {\n\tif (\n\t\tvalue === null ||\n\t\tvalue === void 0\n\t) {\n\t\treturn null;\n\t}\n\t// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:\n\tvalue = Object( value );\n\n\treturn getProto( value );\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\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 { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport objectInverse from '@stdlib/object-inverse';\nimport dtypeEnums from '@stdlib/ndarray-base-dtype-enums';\n\n\n// VARIABLES //\n\nvar hash = objectInverse( dtypeEnums(), {\n\t'duplicates': false\n});\n\n\n// MAIN //\n\n/**\n* Returns the data type string associated with an ndarray data type enumeration constant.\n*\n* @param {integer} dtype - data type enumeration constant\n* @returns {(string|null)} data type string or null\n*\n* @example\n* import str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n*\n* var v = str2enum( 'float64' );\n* // returns \n*\n* var dt = enum2str( v );\n* // returns 'float64'\n*/\nfunction enum2str( dtype ) {\n\tvar v = hash[ dtype ];\n\treturn ( isString( v ) ) ? v : null; // note: we include this guard to prevent walking the prototype chain\n}\n\n\n// EXPORTS //\n\nexport default enum2str;\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 objectKeys from '@stdlib/utils-keys';\nimport isArray from '@stdlib/assert-is-array';\nimport isObject from '@stdlib/assert-is-plain-object';\nimport isObjectLike from '@stdlib/assert-is-object-like';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Inverts an object, such that keys become values and values become keys.\n*\n* @param {ObjectLike} obj - input object\n* @param {Options} [opts] - function options\n* @param {boolean} [opts.duplicates=true] - boolean indicating whether to store duplicate keys\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} second argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Object} inverted object\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'boop'\n* });\n* // returns { 'beep': 'a', 'boop': 'b' }\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'beep'\n* });\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var out = invert( obj, {\n* 'duplicates': false\n* });\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\nfunction invert( obj, opts ) {\n\tvar allowDupes = true;\n\tvar keys;\n\tvar len;\n\tvar key;\n\tvar val;\n\tvar out;\n\tvar v;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'duplicates' ) ) {\n\t\t\tallowDupes = opts.duplicates;\n\t\t\tif ( !isBoolean( allowDupes ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'duplicates', allowDupes ) );\n\t\t\t}\n\t\t}\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = {};\n\tif ( allowDupes ) {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = obj[ key ];\n\t\t\tif ( !hasOwnProp( out, val ) ) {\n\t\t\t\tout[ val ] = key;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tv = out[ val ];\n\t\t\tif ( isArray( v ) ) {\n\t\t\t\tout[ val ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ val ] = [ v, key ];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tout[ obj[ key ] ] = key;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default invert;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 stdlib/empty-line-before-comment */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping supported data type strings to enumeration constants.\n*\n* ## Notes\n*\n* - Downstream consumers of this mapping should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the object should be used in an opaque manner.\n* - The main purpose of this function is JavaScript and C inter-operation of ndarray objects.\n*\n* @returns {Object} object mapping supported data type strings to enumeration constants\n*\n* @example\n* var table = dtypeEnums();\n* // returns {...}\n*/\nfunction dtypeEnums() {\n\t// NOTE: the following should match the C enumeration in `@stdlib/ndarray/dtypes`!!!!\n\treturn {\n\t\t// Boolean data types:\n\t\t'bool': 0,\n\n\t\t// Integer data types:\n\t\t'int8': 1,\n\t\t'uint8': 2,\n\t\t'uint8c': 3,\n\t\t'int16': 4,\n\t\t'uint16': 5,\n\t\t'int32': 6,\n\t\t'uint32': 7,\n\t\t'int64': 8,\n\t\t'uint64': 9,\n\t\t// 'int128': 10, // uncomment once supported\n\t\t// 'uint128': 11,\n\t\t// 'int256': 12,\n\t\t// 'uint256': 13,\n\n\t\t// Floating-point data types:\n\t\t'float16': 10,\n\t\t// 'bfloat16': 15,\n\t\t'float32': 11,\n\t\t'float64': 12,\n\t\t// 'float128': 18, // uncomment once supported\n\n\t\t// Complex floating-point number data types:\n\t\t'complex32': 13,\n\t\t'complex64': 14,\n\t\t'complex128': 15,\n\n\t\t// Data type for \"binary\" data (i.e., data stored in a Node.js `Buffer` object):\n\t\t'binary': 16,\n\n\t\t// Data type for \"generic\" JavaScript values (objects):\n\t\t'generic': 17,\n\n\t\t// Define a signaling value which is guaranteed not to be a valid type enumeration value:\n\t\t'notype': 18,\n\n\t\t// Indicate the start of user defined type numbers (leaving room for type growth above):\n\t\t'userdefined_type': 256\n\t};\n}\n\n\n// EXPORTS //\n\nexport default dtypeEnums;\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 isString } from '@stdlib/assert-is-string';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport enum2str from '@stdlib/ndarray-base-dtype-enum2str';\nimport BYTES_PER_ELEMENT from './bytes_per_element.json';\n\n\n// MAIN //\n\n/**\n* Returns the number of bytes per element for a provided underlying ndarray data type.\n*\n* @param {*} dtype - data type\n* @returns {(PositiveInteger|null)} number of bytes per element\n*\n* @example\n* var nbytes = bytesPerElement( 'float64' );\n* // returns 8\n*\n* nbytes = bytesPerElement( 'generic' );\n* // returns null\n*\n* @example\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var schema = [\n* {\n* 'name': 'value',\n* 'type': 'float64'\n* }\n* ];\n* var Struct = structFactory( schema );\n* // returns \n*\n* var nbytes = bytesPerElement( Struct );\n* // returns 8\n*/\nfunction bytesPerElement( dtype ) {\n\tvar v;\n\tif ( isString( dtype ) ) {\n\t\treturn BYTES_PER_ELEMENT[ dtype ] || null;\n\t}\n\tif ( isNumber( dtype ) ) {\n\t\treturn BYTES_PER_ELEMENT[ enum2str( dtype ) ] || null;\n\t}\n\tif ( dtype ) {\n\t\tv = dtype.byteLength;\n\t\tif ( isPositiveInteger( v ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default bytesPerElement;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2026 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 defaults = {\n\t// Define a default block size (in bytes):\n\t'BLOCK_SIZE_IN_BYTES': 64|0, // 64b is a common cache line size. How applicable the common cache line size is here is debatable, given that, depending on the associated stride(s), the innermost loop may not iterate over adjacent elements. The primary goal is to have a block size in which all data within a block can always fit in (L1) cache, regardless of cache size (i.e., cache-oblivious). For reference, a common L1 cache size is 32kB per core. For best performance, block sizes should be tuned based on system hardware; however, such tuning is not readily available to us here. Without obvious better alternatives, 64b has some theoretical (and practical) underpinning, and it should be good enough for most inputs, especially for ndarrays with near contiguity.\n\n\t// Define a default block size (in elements):\n\t'BLOCK_SIZE_IN_ELEMENTS': 8|0 // 64 bytes / 8 bytes per element (i.e., default element size is same as a double)\n};\n\n\n// EXPORTS //\n\nexport default defaults;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 blockSize from '@stdlib/ndarray-base-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Returns a loop block size for multi-dimensional array tiled loops.\n*\n* @param {*} dtypeX - array data type\n* @returns {integer} block size (in units of elements)\n*\n* @example\n* var bsize = nullaryBlockSize( 'float64' );\n* // returns \n*/\nfunction nullaryBlockSize( dtypeX ) {\n\treturn blockSize( [ dtypeX ] );\n}\n\n\n// EXPORTS //\n\nexport default nullaryBlockSize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2026 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 bytesPerElement from '@stdlib/ndarray-base-bytes-per-element';\nimport defaults from './defaults.js';\n\n\n// MAIN //\n\n/**\n* Returns a loop block size for multi-dimensional array tiled loops.\n*\n* @param {ArrayLikeObject} dtypes - list of input and output ndarray data types\n* @returns {integer} block size (in units of elements)\n*\n* @example\n* var bsize = blockSize( [ 'float64', 'float64', 'float64', 'float64' ] );\n* // returns \n*/\nfunction blockSize( dtypes ) {\n\tvar max;\n\tvar len;\n\tvar nb;\n\tvar i;\n\n\tlen = dtypes.length;\n\tif ( len <= 0 ) {\n\t\treturn defaults.BLOCK_SIZE_IN_ELEMENTS;\n\t}\n\tmax = bytesPerElement( dtypes[ 0 ] );\n\tif ( max === null ) {\n\t\treturn defaults.BLOCK_SIZE_IN_ELEMENTS; // e.g., \"generic\" arrays\n\t}\n\t// Find the largest element size among all arrays...\n\tfor ( i = 1; i < len; i++ ) {\n\t\tnb = bytesPerElement( dtypes[ i ] );\n\t\tif ( nb === null ) {\n\t\t\treturn defaults.BLOCK_SIZE_IN_ELEMENTS; // e.g., \"generic\" arrays\n\t\t}\n\t\tif ( nb > max ) {\n\t\t\tmax = nb;\n\t\t}\n\t}\n\tnb = ( defaults.BLOCK_SIZE_IN_BYTES/max )|0; // asm type annotation\n\treturn ( nb > 0 ) ? nb : 1|0;\n}\n\n\n// EXPORTS //\n\nexport default blockSize;\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 isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Converts a linear index in an array view to a linear index in an underlying data buffer.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @param {NonNegativeInteger} offset - location of the first indexed value **based** on the stride array\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @param {integer} idx - linear index in an array view\n* @param {string} mode - specifies how to handle a linear index which exceeds array dimensions\n* @throws {RangeError} linear index must not exceed array dimensions\n* @returns {NonNegativeInteger} linear index in an underlying data buffer\n*\n* @example\n* var shape = [ 3, 3 ];\n* var strides = [ -3, 1 ];\n* var offset = 6;\n* var order = 'row-major';\n* var mode = 'throw';\n*\n* var ind = vind2bind( shape, strides, offset, order, 1, mode );\n* // returns 7\n*/\nfunction vind2bind( shape, strides, offset, order, idx, mode ) {\n\tvar ndims;\n\tvar len;\n\tvar ind;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tlen = 1;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tlen *= shape[ i ];\n\t}\n\tif ( mode === 'clamp' ) {\n\t\tif ( idx < 0 ) {\n\t\t\tidx = 0;\n\t\t} else if ( idx >= len ) {\n\t\t\tidx = len - 1;\n\t\t}\n\t} else if ( mode === 'wrap' ) {\n\t\tif ( idx < 0 ) {\n\t\t\tidx += len; // slight optimization to avoid modulo arithmetic when |idx| <= len\n\t\t\tif ( idx < 0 ) {\n\t\t\t\tidx %= len;\n\t\t\t\tif ( idx !== 0 ) {\n\t\t\t\t\tidx += len;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( idx >= len ) {\n\t\t\tidx -= len; // slight optimization to avoid modulo arithmetic when len < idx <= 2*len\n\t\t\tif ( idx >= len ) {\n\t\t\t\tidx %= len;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ( mode === 'normalize' && idx < 0 ) {\n\t\t\tidx += len;\n\t\t}\n\t\tif ( idx < 0 || idx >= len ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.', len, idx ) );\n\t\t}\n\t}\n\t// The approach which follows is to resolve a view index to its subscripts and then plug the subscripts into the standard formula for computing the linear index in the underlying data buffer...\n\tind = offset;\n\tif ( isColumnMajor( order ) ) {\n\t\tfor ( i = 0; i < ndims; i++ ) {\n\t\t\ts = idx % shape[ i ];\n\t\t\tidx -= s;\n\t\t\tidx /= shape[ i ];\n\t\t\tind += s * strides[ i ];\n\t\t}\n\t\treturn ind;\n\t}\n\t// Case: row-major\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\ts = idx % shape[ i ];\n\t\tidx -= s;\n\t\tidx /= shape[ i ];\n\t\tind += s * strides[ i ];\n\t}\n\treturn ind;\n}\n\n\n// EXPORTS //\n\nexport default vind2bind;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport numel from '@stdlib/ndarray-base-numel';\nimport vind2bind from '@stdlib/ndarray-base-vind2bind';\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar get;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !get( xbuf, ix ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default everynd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport numel from '@stdlib/ndarray-base-numel';\nimport vind2bind from '@stdlib/ndarray-base-vind2bind';\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default everynd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport numel from '@stdlib/ndarray-base-numel';\nimport vind2bind from '@stdlib/ndarray-base-vind2bind';\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !xbuf[ ix ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default everynd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 isComplexArray from '@stdlib/array-base-assert-is-complex-typed-array';\nimport isBooleanArray from '@stdlib/array-base-assert-is-booleanarray';\nimport iterationOrder from '@stdlib/ndarray-base-iteration-order';\nimport minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\nimport ndarray2object from '@stdlib/ndarray-base-ndarraylike2object';\nimport reinterpretComplex from '@stdlib/strided-base-reinterpret-complex';\nimport reinterpretBoolean from '@stdlib/strided-base-reinterpret-boolean';\nimport gscal from '@stdlib/blas-base-gscal';\nimport blockedaccessorevery2d from './2d_blocked_accessors.js';\nimport blockedaccessorevery3d from './3d_blocked_accessors.js';\nimport blockedaccessorevery4d from './4d_blocked_accessors.js';\nimport blockedaccessorevery5d from './5d_blocked_accessors.js';\nimport blockedaccessorevery6d from './6d_blocked_accessors.js';\nimport blockedaccessorevery7d from './7d_blocked_accessors.js';\nimport blockedaccessorevery8d from './8d_blocked_accessors.js';\nimport blockedaccessorevery9d from './9d_blocked_accessors.js';\nimport blockedaccessorevery10d from './10d_blocked_accessors.js';\nimport blockedcomplexevery2d from './2d_blocked_complex.js';\nimport blockedcomplexevery3d from './3d_blocked_complex.js';\nimport blockedcomplexevery4d from './4d_blocked_complex.js';\nimport blockedcomplexevery5d from './5d_blocked_complex.js';\nimport blockedcomplexevery6d from './6d_blocked_complex.js';\nimport blockedcomplexevery7d from './7d_blocked_complex.js';\nimport blockedcomplexevery8d from './8d_blocked_complex.js';\nimport blockedcomplexevery9d from './9d_blocked_complex.js';\nimport blockedcomplexevery10d from './10d_blocked_complex.js';\nimport blockedevery2d from './2d_blocked.js';\nimport blockedevery3d from './3d_blocked.js';\nimport blockedevery4d from './4d_blocked.js';\nimport blockedevery5d from './5d_blocked.js';\nimport blockedevery6d from './6d_blocked.js';\nimport blockedevery7d from './7d_blocked.js';\nimport blockedevery8d from './8d_blocked.js';\nimport blockedevery9d from './9d_blocked.js';\nimport blockedevery10d from './10d_blocked.js';\nimport accessorevery0d from './0d_accessors.js';\nimport accessorevery1d from './1d_accessors.js';\nimport accessorevery2d from './2d_accessors.js';\nimport accessorevery3d from './3d_accessors.js';\nimport accessorevery4d from './4d_accessors.js';\nimport accessorevery5d from './5d_accessors.js';\nimport accessorevery6d from './6d_accessors.js';\nimport accessorevery7d from './7d_accessors.js';\nimport accessorevery8d from './8d_accessors.js';\nimport accessorevery9d from './9d_accessors.js';\nimport accessorevery10d from './10d_accessors.js';\nimport accessoreverynd from './nd_accessors.js';\nimport complexevery0d from './0d_complex.js';\nimport complexevery1d from './1d_complex.js';\nimport complexevery2d from './2d_complex.js';\nimport complexevery3d from './3d_complex.js';\nimport complexevery4d from './4d_complex.js';\nimport complexevery5d from './5d_complex.js';\nimport complexevery6d from './6d_complex.js';\nimport complexevery7d from './7d_complex.js';\nimport complexevery8d from './8d_complex.js';\nimport complexevery9d from './9d_complex.js';\nimport complexevery10d from './10d_complex.js';\nimport complexeverynd from './nd_complex.js';\nimport every0d from './0d.js';\nimport every1d from './1d.js';\nimport every2d from './2d.js';\nimport every3d from './3d.js';\nimport every4d from './4d.js';\nimport every5d from './5d.js';\nimport every6d from './6d.js';\nimport every7d from './7d.js';\nimport every8d from './8d.js';\nimport every9d from './9d.js';\nimport every10d from './10d.js';\nimport everynd from './nd.js';\n\n\n// VARIABLES //\n\nvar EVERY = [\n\tevery0d,\n\tevery1d,\n\tevery2d,\n\tevery3d,\n\tevery4d,\n\tevery5d,\n\tevery6d,\n\tevery7d,\n\tevery8d,\n\tevery9d,\n\tevery10d\n];\nvar ACCESSOR_EVERY = [\n\taccessorevery0d,\n\taccessorevery1d,\n\taccessorevery2d,\n\taccessorevery3d,\n\taccessorevery4d,\n\taccessorevery5d,\n\taccessorevery6d,\n\taccessorevery7d,\n\taccessorevery8d,\n\taccessorevery9d,\n\taccessorevery10d\n];\nvar COMPLEX_EVERY = [\n\tcomplexevery0d,\n\tcomplexevery1d,\n\tcomplexevery2d,\n\tcomplexevery3d,\n\tcomplexevery4d,\n\tcomplexevery5d,\n\tcomplexevery6d,\n\tcomplexevery7d,\n\tcomplexevery8d,\n\tcomplexevery9d,\n\tcomplexevery10d\n];\nvar BLOCKED_EVERY = [\n\tblockedevery2d, // 0\n\tblockedevery3d,\n\tblockedevery4d,\n\tblockedevery5d,\n\tblockedevery6d,\n\tblockedevery7d,\n\tblockedevery8d,\n\tblockedevery9d,\n\tblockedevery10d // 8\n];\nvar BLOCKED_ACCESSOR_EVERY = [\n\tblockedaccessorevery2d, // 0\n\tblockedaccessorevery3d,\n\tblockedaccessorevery4d,\n\tblockedaccessorevery5d,\n\tblockedaccessorevery6d,\n\tblockedaccessorevery7d,\n\tblockedaccessorevery8d,\n\tblockedaccessorevery9d,\n\tblockedaccessorevery10d // 8\n];\nvar BLOCKED_COMPLEX_EVERY = [\n\tblockedcomplexevery2d, // 0\n\tblockedcomplexevery3d,\n\tblockedcomplexevery4d,\n\tblockedcomplexevery5d,\n\tblockedcomplexevery6d,\n\tblockedcomplexevery7d,\n\tblockedcomplexevery8d,\n\tblockedcomplexevery9d,\n\tblockedcomplexevery10d // 8\n];\nvar MAX_DIMS = EVERY.length - 1;\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* ## Notes\n*\n* - A provided ndarray should be an object with the following properties:\n*\n* - **dtype**: data type.\n* - **data**: data buffer.\n* - **shape**: dimensions.\n* - **strides**: stride lengths.\n* - **offset**: index offset.\n* - **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style).\n*\n* @param {ArrayLikeObject} arrays - array-like object containing one input array\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every( [ x ] );\n* // returns true\n*/\nfunction every( arrays ) {\n\tvar isCmplx;\n\tvar ndims;\n\tvar xmmv;\n\tvar shx;\n\tvar iox;\n\tvar len;\n\tvar sx;\n\tvar ox;\n\tvar ns;\n\tvar x;\n\tvar d;\n\tvar i;\n\n\t// Unpack the ndarray and standardize ndarray meta data:\n\tx = ndarray2object( arrays[ 0 ] );\n\tshx = x.shape;\n\tndims = shx.length;\n\n\t// Check for known array types which can be reinterpreted for better iteration performance...\n\tif ( isBooleanArray( x.data ) ) {\n\t\tx.data = reinterpretBoolean( x.data, 0 );\n\t\tx.accessorProtocol = false;\n\t} else if ( isComplexArray( x.data ) ) {\n\t\tx.data = reinterpretComplex( x.data, 0 );\n\t\tx.accessorProtocol = false;\n\t\tx.strides = gscal( ndims, 2, x.strides, 1 );\n\t\tx.offset *= 2;\n\t\tisCmplx = true;\n\t}\n\t// Determine whether we can avoid iteration altogether...\n\tif ( ndims === 0 ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t}\n\t\treturn EVERY[ ndims ]( x );\n\t}\n\t// Compute the number of elements and the number of singleton dimensions...\n\tlen = 1; // number of elements\n\tns = 0; // number of singleton dimensions\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\td = shx[ i ];\n\n\t\t// Note that, if one of the dimensions is `0`, the length will be `0`...\n\t\tlen *= d;\n\n\t\t// Check whether the current dimension is a singleton dimension...\n\t\tif ( d === 1 ) {\n\t\t\tns += 1;\n\t\t}\n\t}\n\t// Check whether we were provided an empty ndarray...\n\tif ( len === 0 ) {\n\t\treturn true;\n\t}\n\t// Determine whether the ndarray is one-dimensional and thus readily translates to a one-dimensional strided array...\n\tif ( ndims === 1 ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t}\n\t\treturn EVERY[ ndims ]( x );\n\t}\n\tsx = x.strides;\n\n\t// Determine whether the ndarray has only **one** non-singleton dimension (e.g., ndims=4, shape=[10,1,1,1]) so that we can treat an ndarray as being equivalent to a one-dimensional strided array...\n\tif ( ns === ndims-1 ) {\n\t\t// Get the index of the non-singleton dimension...\n\t\tfor ( i = 0; i < ndims; i++ ) {\n\t\t\tif ( shx[ i ] !== 1 ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tx.shape = [ shx[i] ];\n\t\tx.strides = [ sx[i] ];\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ 1 ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ 1 ]( x );\n\t\t}\n\t\treturn EVERY[ 1 ]( x );\n\t}\n\tiox = iterationOrder( sx ); // +/-1\n\n\t// Determine whether we can avoid blocked iteration...\n\tif ( iox !== 0 ) {\n\t\t// Determine the minimum and maximum linear indices which are accessible by the array view:\n\t\txmmv = minmaxViewBufferIndex( shx, sx, x.offset );\n\n\t\t// Determine whether we can ignore shape (and strides) and treat the ndarray as a linear one-dimensional strided array...\n\t\tif ( len === ( xmmv[1]-xmmv[0]+1 ) || ( isCmplx && len*2 === ( xmmv[1]-xmmv[0]+2 ) ) ) { // eslint-disable-line max-len\n\t\t\t// Note: the above is equivalent to @stdlib/ndarray/base/assert/is-contiguous, but in-lined so we can retain computed values...\n\t\t\tif ( iox === 1 ) {\n\t\t\t\tox = xmmv[ 0 ];\n\t\t\t} else {\n\t\t\t\tox = xmmv[ 1 ];\n\t\t\t}\n\t\t\tx.shape = [ len ];\n\t\t\tx.strides = [ ( isCmplx ) ? iox*2 : iox ];\n\t\t\tx.offset = ox;\n\t\t\tif ( x.accessorProtocol ) {\n\t\t\t\treturn ACCESSOR_EVERY[ 1 ]( x );\n\t\t\t}\n\t\t\tif ( isCmplx ) {\n\t\t\t\treturn COMPLEX_EVERY[ 1 ]( x );\n\t\t\t}\n\t\t\treturn EVERY[ 1 ]( x );\n\t\t}\n\t\t// The ndarray is non-contiguous, so we cannot directly use one-dimensional array functionality...\n\n\t\t// Determine whether we can use simple nested loops...\n\t\tif ( ndims <= MAX_DIMS ) {\n\t\t\t// So long as iteration always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration...\n\t\t\tif ( x.accessorProtocol ) {\n\t\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t\t}\n\t\t\tif ( isCmplx ) {\n\t\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t\t}\n\t\t\treturn EVERY[ ndims ]( x );\n\t\t}\n\t\t// Fall-through to blocked iteration...\n\t}\n\t// At this point, we're either dealing with a non-contiguous n-dimensional array or a high dimensional n-dimensional array, so our only hope is that we can still perform blocked iteration...\n\n\t// Determine whether we can perform blocked iteration...\n\tif ( ndims <= MAX_DIMS ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn BLOCKED_ACCESSOR_EVERY[ ndims-2 ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn BLOCKED_COMPLEX_EVERY[ ndims-2 ]( x );\n\t\t}\n\t\treturn BLOCKED_EVERY[ ndims-2 ]( x );\n\t}\n\t// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...\n\tif ( x.accessorProtocol ) {\n\t\treturn accessoreverynd( x );\n\t}\n\tif ( isCmplx ) {\n\t\treturn complexeverynd( x );\n\t}\n\treturn everynd( x );\n}\n\n\n// EXPORTS //\n\nexport default every;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.data[ x.offset ] ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default every0d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 2 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments:\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !xbuf[ ix ] ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every1d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.accessors[ 0 ]( x.data, x.offset ) ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default every0d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments...\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !get( xbuf, ix ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every1d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.data[ x.offset ] || x.data[ x.offset+1 ] ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default every0d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments:\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every1d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `BooleanArray` as a `Uint8Array`.\n*\n* @param {BooleanArray} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Uint8Array} `Uint8Array` view\n*\n* @example\n* import BooleanArray from '@stdlib/array-bool';\n*\n* var x = new BooleanArray( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Uint8Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Reinterprets a complex-valued floating-point array as a real-valued floating-point array having the same precision.\n*\n* @param {(Complex128Array|Complex64Array)} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @throws {TypeError} first argument must be a supported complex-valued floating-point array\n* @returns {(Float64Array|Float32Array)} real-valued floating-point array view\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\tif ( isComplex128Array( x ) ) {\n\t\treturn reinterpret128( x, offset );\n\t}\n\tif ( isComplex64Array( x ) ) {\n\t\treturn reinterpret64( x, offset );\n\t}\n\t// Note: intentionally throw here to catch the scenario in which we add, e.g., a Complex32Array and need to explicitly add support here...\n\tthrow new TypeError( format( 'invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns array iteration order.\n*\n* ## Notes\n*\n* - Return value key:\n*\n* - `0`: unordered (i.e., strides of mixed sign; e.g., `[ 9, -3, 1 ]`)\n* - `1`: ordered left-to-right (i.e., all nonnegative strides)\n* - `-1`: ordered right-to-left (i.e., all negative strides)\n*\n* @param {IntegerArray} strides - stride array\n* @returns {integer} iteration order\n*\n* @example\n* var o = iterationOrder( [ 2, 1 ] );\n* // returns 1\n*\n* o = iterationOrder( [ -2, 1 ] );\n* // returns 0\n*\n* o = iterationOrder( [ -2, -1 ] );\n* // returns -1\n*/\nfunction iterationOrder( strides ) {\n\tvar cnt;\n\tvar i;\n\n\tcnt = 0;\n\tfor ( i = 0; i < strides.length; i++ ) {\n\t\tif ( strides[ i ] < 0 ) {\n\t\t\tcnt += 1;\n\t\t}\n\t}\n\tif ( cnt === 0 ) {\n\t\t// All nonnegative strides:\n\t\treturn 1|0; // asm-type annotation\n\t}\n\tif ( cnt === strides.length ) {\n\t\t// All negative strides:\n\t\treturn -1|0; // asm-type annotation\n\t}\n\t// Strides of mixed signs:\n\treturn 0|0; // asm-type annotation\n}\n\n\n// EXPORTS //\n\nexport default iterationOrder;\n"],"names":["C64_BYTES_PER_ELEMENT","C128_BYTES_PER_ELEMENT","BYTES_PER_ELEMENT","main","Object","defineProperty","isNumber","value","zeros","n","i","out","zeroPad","str","width","right","negative","pad","length","startsWithMinus","substr","lowercase","String","prototype","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","toString","precision","padRight","sign","alternate","call","charAt","abs","Math","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","f","digits","toExponential","toFixed","toPrecision","spaces","fromCharCode","isArray","Array","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","parseFloat","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","push","format","args","tokenize","interpolate","apply","objectProtoype","toStr","defineGetter","__defineGetter__","defineSetter","__defineSetter__","lookupGetter","__lookupGetter__","lookupSetter","__lookupSetter__","err","hasDefinePropertySupport","builtin","obj","prop","descriptor","hasValue","hasGet","hasSet","__proto__","get","set","defineProperty$1","setNonEnumerableReadOnly","configurable","enumerable","writable","minmaxViewBufferIndex","shape","strides","offset","ndims","min","max","s","setReadOnly","TYPE","isAccessorArray","GETTERS","complex128","arr","idx","complex64","default","getter","dtype","SETTERS","setter","float64","float32","int32","int16","int8","uint32","uint16","uint8","uint8c","generic","numel","copy","x","len","isString","FLG","Symbol","hasToStringTagSupport","toStringTag","has","hasOwnProperty","hasOwnProp","property","Sym","toStrTag","nativeClass","hasToStringTag","v","isOwn","tag","valueOf","test","isPrimitive","isObject","isColumnMajorString","shape2strides","order","isColumnMajor","columnmajor","rowmajor","ROW_MAJOR","ord","sh","st","copyIndexed","main$c","Number","o","strides2offset","strides2order","column","row","s1","s2","COLUMN_MAJOR","ndarraylike2object","xbuf","bool","dt","data","getData","getShape","getDType","ref","getStrides","getOffset","getOrder","accessorProtocol","accessors","accessorGetter","accessorSetter","isComplex128Array","constructor","name","isComplex64Array","ctor","hasFloat64Array","Float64Array","GlobalFloat64Array","NaN","hasFloat64ArraySupport","Float64Array$1","reinterpret","buffer","byteOffset","hasFloat32Array","Float32Array","FLOAT64_PINF","POSITIVE_INFINITY","GlobalFloat32Array","PINF","hasFloat32ArraySupport","Float32Array$1","hasUint8Array","Uint8Array","GlobalUint8Array","UINT8_MAX","hasUint8ArraySupport","Uint8Array$1","main$8","arrayfcn","predicate","isObjectLike","isBuffer","_isBuffer","reFunctionName","arrayfun","RE_FUNCTION_NAME","constructorName","REGEXP","ctor2dtypes","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8ClampedArray","Complex64Array","Complex128Array","BooleanArray","hasUint32Array","UINT32_MAX","GlobalUint32Array","hasUint32ArraySupport","Uint32Array$1","hasInt32Array","GlobalInt32Array","INT32_MAX","hasInt32ArraySupport","Int32Array$1","hasUint16Array","GlobalUint16Array","UINT16_MAX","hasUint16ArraySupport","Uint16Array$1","hasInt16Array","GlobalInt16Array","INT16_MAX","hasInt16ArraySupport","Int16Array$1","hasUint8ClampedArray","GlobalUint8ClampedArray","hasUint8ClampedArraySupport","Uint8ClampedArray$1","hasInt8Array","GlobalInt8Array","INT8_MAX","hasInt8ArraySupport","Int8Array$1","FLOAT64_NINF","NEGATIVE_INFINITY","floor","isInteger","NINF","isInt","isNonNegativeInteger","MAX_ARRAY_LENGTH","isArrayLikeObject","MAX_LENGTH","MAX_TYPED_ARRAY_LENGTH","isCollection","hasArrayBuffer","ArrayBuffer","isArrayBuffer","isPrimitiveArray","isObjectArray","isStringArray","isBoolean","Bool","Boolean","self","window","globalThis","root","codegen","Function","GlobalThis","Self","Win","getGlobal","nodeList","document","childNodes","typedarray","ctorName","type","isFunction","typeOf","Complex128","real","imag","this","setEnumerableReadOnly","re","im","fround","FLOAT32_VIEW","float64ToFloat32$1","Complex64","float64ToFloat32","isComplexLike","isEven","hasIteratorSymbolSupport","iterator","IteratorSymbol","setNonEnumerableReadOnlyAccessor","z","fromIterator","it","next","done","realf","imagf","HAS_ITERATOR_SYMBOL","isComplexArray","_length","_buffer","isComplexArrayConstructor","getComplex64","buf","nargs","fromArray","RangeError","reinterpret64","reinterpret128","byteLength","ITERATOR_SYMBOL","src","thisArg","clbk","tmp","flg","fromIteratorMap","target","start","copyWithin","iter","entries","end","fcn","searchElement","fromIndex","separator","sep","join","keys","outbuf","reducer","initialValue","acc","N","sbuf","outlen","compareFcn","sort","begin","locales","options","opts","loc","toLocaleString","values","index","getComplex128","isBooleanArray","isBooleanArrayConstructor","val","a","b","CTORS","DTYPES","NTYPES","arraylike2object","ctor2dtype","M","gscal","alpha","stride","ix","m","xget","xset","ndarray","stride2offset","zeroTo","complex","loopOrder","sx","y","avx","iy","jx","jy","vx","vy","ux","sort2ins","indices","take","isPositiveInteger","indexed","isArguments","bool$6","detect","hasArgumentsClass","isNan","isEnumerableProperty","propertyIsEnumerable","hasStringEnumBug","isEnum","isArguments$1","isConstructorPrototype","w","hasAutomationEqualityBug","k","win","EXCLUDED_KEYS","check","HAS_BUILTIN","skipConstructor","skipPrototype","isFcn","p","HAS_ENUM_PROTO_BUG","HAS_NON_ENUM_PROPS_BUG","HAS_WINDOW","error","NON_ENUMERABLE","getProto","Obj","getPrototypeOf","proto","getProto$1","objectPrototype","isPlainObject","isPrototypeOf","key","ownProps","hash","allowDupes","duplicates","objectKeys","objectInverse","int64","uint64","float16","complex32","binary","notype","userdefined_type","bytesPerElement","enum2str","defaults","BLOCK_SIZE_IN_BYTES","BLOCK_SIZE_IN_ELEMENTS","nullaryBlockSize","dtypeX","dtypes","nb","blockSize","vind2bind","mode","ind","MODE","EVERY","dx0","S0","i0","dx1","S1","i1","dx2","S2","i2","dx3","S3","i3","dx4","S4","i4","dx5","S5","i5","dx6","S6","i6","dx7","S7","i7","dx8","S8","i8","dx9","S9","i9","ACCESSOR_EVERY","COMPLEX_EVERY","BLOCKED_EVERY","bsize","ox1","s0","ox","j0","j1","ox2","j2","ox3","s3","j3","ox4","s4","j4","ox5","s5","j5","ox6","s6","j6","ox7","s7","j7","ox8","s8","j8","ox9","s9","j9","BLOCKED_ACCESSOR_EVERY","BLOCKED_COMPLEX_EVERY","MAX_DIMS","arrays","isCmplx","xmmv","shx","iox","ns","d","ndarray2object","reinterpretBoolean","reinterpretComplex","cnt","iterationOrder","ordx","accessoreverynd","complexeverynd","everynd"],"mappings":"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","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,332,333,334]} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 4ca61c4..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import every from '../docs/types/index'; -export = every; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index ec8cd6c..0000000 --- a/dist/index.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict";var K=function(a,r){return function(){try{return r||a((r={exports:{}}).exports,r),r.exports}catch(h){throw (r=0, h)}};};var dr=K(function(G0,tr){ -var Pv=require('@stdlib/ndarray-base-nullary-loop-interchange-order/dist'),Rv=require('@stdlib/ndarray-base-nullary-tiling-block-size/dist');function _v(a){var r,h,O,z,k,y,S,x,t,v,s,e,f,c,o,l,n;for(n=Pv(a.shape,a.strides),S=n.sh,v=n.sx,r=Rv(a.dtype),s=a.offset,h=a.data,z=v[0],O=a.accessors[0],l=S[1];l>0;)for(l0;)for(o0;)for(i0;)for(j0;)for(d0;)for(C0;)for(m0;)for(b0;)for(p0;)for(_0;)for(E0;)for(D0;)for(R0;)for(g0;)for(Y0;)for(B0;)for(M0;)for(P0;)for(V0;)for(_0;)for(I0;)for(L0;)for(A0;)for(w0;)for(X0;)for(Y0;)for(B0;)for(N0;)for(J0;)for(H0;)for(G0;)for(F0;)for(I0;)for(L0;)for(A0;)for(Z0;)for(W0;)for(U0;)for(T0;)for(Q0;)for(N0;)for(J0;)for(H0;)for(G0;)for(er0;)for(vr0;)for(ar0;)for(rr0;)for($0;)for(Z0;)for(W0;)for(U0;)for(T0;)for(Q0;)for(o0;)for(c0;)for(j0;)for(d0;)for(u0;)for(m0;)for(b0;)for(p0;)for(q0;)for(E0;)for(D0;)for(R0;)for(g0;)for(C0;)for(B0;)for(M0;)for(P0;)for(V0;)for(_0;)for(E0;)for(L0;)for(A0;)for(w0;)for(X0;)for(Y0;)for(B0;)for(M0;)for(J0;)for(H0;)for(G0;)for(F0;)for(I0;)for(L0;)for(A0;)for(w0;)for(W0;)for(U0;)for(T0;)for(Q0;)for(N0;)for(J0;)for(H0;)for(G0;)for(F0;)for(vr0;)for(ar0;)for(rr0;)for($0;)for(Z0;)for(W0;)for(U0;)for(T0;)for(Q0;)for(N0;)for(o0;)for(c0;)for(j0;)for(d0;)for(u0;)for(m0;)for(b0;)for(p0;)for(q0;)for(E0;)for(D0;)for(R0;)for(g0;)for(C0;)for(B0;)for(M0;)for(P0;)for(V0;)for(_0;)for(E0;)for(L0;)for(A0;)for(w0;)for(X0;)for(Y0;)for(B0;)for(M0;)for(J0;)for(H0;)for(G0;)for(F0;)for(I0;)for(L0;)for(A0;)for(w0;)for(W0;)for(U0;)for(T0;)for(Q0;)for(N0;)for(J0;)for(H0;)for(G0;)for(F0;)for(vr0;)for(ar0;)for(rr0;)for($0;)for(Z0;)for(W0;)for(U0;)for(T0;)for(Q0;)for(N} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' );\nvar blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = blockedevery10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.accessors[ 0 ]( x.data, x.offset ) ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every0d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments...\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !get( xbuf, ix ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every1d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar vind2bind = require( '@stdlib/ndarray-base-vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' );\n* var accessors = require( '@stdlib/array-base-accessors' );\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar get;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !get( xbuf, ix ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = everynd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.data[ x.offset ] || x.data[ x.offset+1 ] ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every0d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments:\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every1d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar vind2bind = require( '@stdlib/ndarray-base-vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = everynd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.data[ x.offset ] ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every0d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 2 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments:\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !xbuf[ ix ] ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every1d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every2d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every3d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every4d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every5d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every6d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every7d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every8d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every9d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nvar strides2order = require( '@stdlib/ndarray-base-strides2order' );\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = every10d;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar vind2bind = require( '@stdlib/ndarray-base-vind2bind' );\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !xbuf[ ix ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = everynd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isComplexArray = require( '@stdlib/array-base-assert-is-complex-typed-array' );\nvar isBooleanArray = require( '@stdlib/array-base-assert-is-booleanarray' );\nvar iterationOrder = require( '@stdlib/ndarray-base-iteration-order' );\nvar minmaxViewBufferIndex = require( '@stdlib/ndarray-base-minmax-view-buffer-index' );\nvar ndarray2object = require( '@stdlib/ndarray-base-ndarraylike2object' );\nvar reinterpretComplex = require( '@stdlib/strided-base-reinterpret-complex' );\nvar reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' );\nvar gscal = require( '@stdlib/blas-base-gscal' );\nvar blockedaccessorevery2d = require( './2d_blocked_accessors.js' );\nvar blockedaccessorevery3d = require( './3d_blocked_accessors.js' );\nvar blockedaccessorevery4d = require( './4d_blocked_accessors.js' );\nvar blockedaccessorevery5d = require( './5d_blocked_accessors.js' );\nvar blockedaccessorevery6d = require( './6d_blocked_accessors.js' );\nvar blockedaccessorevery7d = require( './7d_blocked_accessors.js' );\nvar blockedaccessorevery8d = require( './8d_blocked_accessors.js' );\nvar blockedaccessorevery9d = require( './9d_blocked_accessors.js' );\nvar blockedaccessorevery10d = require( './10d_blocked_accessors.js' );\nvar blockedcomplexevery2d = require( './2d_blocked_complex.js' );\nvar blockedcomplexevery3d = require( './3d_blocked_complex.js' );\nvar blockedcomplexevery4d = require( './4d_blocked_complex.js' );\nvar blockedcomplexevery5d = require( './5d_blocked_complex.js' );\nvar blockedcomplexevery6d = require( './6d_blocked_complex.js' );\nvar blockedcomplexevery7d = require( './7d_blocked_complex.js' );\nvar blockedcomplexevery8d = require( './8d_blocked_complex.js' );\nvar blockedcomplexevery9d = require( './9d_blocked_complex.js' );\nvar blockedcomplexevery10d = require( './10d_blocked_complex.js' );\nvar blockedevery2d = require( './2d_blocked.js' );\nvar blockedevery3d = require( './3d_blocked.js' );\nvar blockedevery4d = require( './4d_blocked.js' );\nvar blockedevery5d = require( './5d_blocked.js' );\nvar blockedevery6d = require( './6d_blocked.js' );\nvar blockedevery7d = require( './7d_blocked.js' );\nvar blockedevery8d = require( './8d_blocked.js' );\nvar blockedevery9d = require( './9d_blocked.js' );\nvar blockedevery10d = require( './10d_blocked.js' );\nvar accessorevery0d = require( './0d_accessors.js' );\nvar accessorevery1d = require( './1d_accessors.js' );\nvar accessorevery2d = require( './2d_accessors.js' );\nvar accessorevery3d = require( './3d_accessors.js' );\nvar accessorevery4d = require( './4d_accessors.js' );\nvar accessorevery5d = require( './5d_accessors.js' );\nvar accessorevery6d = require( './6d_accessors.js' );\nvar accessorevery7d = require( './7d_accessors.js' );\nvar accessorevery8d = require( './8d_accessors.js' );\nvar accessorevery9d = require( './9d_accessors.js' );\nvar accessorevery10d = require( './10d_accessors.js' );\nvar accessoreverynd = require( './nd_accessors.js' );\nvar complexevery0d = require( './0d_complex.js' );\nvar complexevery1d = require( './1d_complex.js' );\nvar complexevery2d = require( './2d_complex.js' );\nvar complexevery3d = require( './3d_complex.js' );\nvar complexevery4d = require( './4d_complex.js' );\nvar complexevery5d = require( './5d_complex.js' );\nvar complexevery6d = require( './6d_complex.js' );\nvar complexevery7d = require( './7d_complex.js' );\nvar complexevery8d = require( './8d_complex.js' );\nvar complexevery9d = require( './9d_complex.js' );\nvar complexevery10d = require( './10d_complex.js' );\nvar complexeverynd = require( './nd_complex.js' );\nvar every0d = require( './0d.js' );\nvar every1d = require( './1d.js' );\nvar every2d = require( './2d.js' );\nvar every3d = require( './3d.js' );\nvar every4d = require( './4d.js' );\nvar every5d = require( './5d.js' );\nvar every6d = require( './6d.js' );\nvar every7d = require( './7d.js' );\nvar every8d = require( './8d.js' );\nvar every9d = require( './9d.js' );\nvar every10d = require( './10d.js' );\nvar everynd = require( './nd.js' );\n\n\n// VARIABLES //\n\nvar EVERY = [\n\tevery0d,\n\tevery1d,\n\tevery2d,\n\tevery3d,\n\tevery4d,\n\tevery5d,\n\tevery6d,\n\tevery7d,\n\tevery8d,\n\tevery9d,\n\tevery10d\n];\nvar ACCESSOR_EVERY = [\n\taccessorevery0d,\n\taccessorevery1d,\n\taccessorevery2d,\n\taccessorevery3d,\n\taccessorevery4d,\n\taccessorevery5d,\n\taccessorevery6d,\n\taccessorevery7d,\n\taccessorevery8d,\n\taccessorevery9d,\n\taccessorevery10d\n];\nvar COMPLEX_EVERY = [\n\tcomplexevery0d,\n\tcomplexevery1d,\n\tcomplexevery2d,\n\tcomplexevery3d,\n\tcomplexevery4d,\n\tcomplexevery5d,\n\tcomplexevery6d,\n\tcomplexevery7d,\n\tcomplexevery8d,\n\tcomplexevery9d,\n\tcomplexevery10d\n];\nvar BLOCKED_EVERY = [\n\tblockedevery2d, // 0\n\tblockedevery3d,\n\tblockedevery4d,\n\tblockedevery5d,\n\tblockedevery6d,\n\tblockedevery7d,\n\tblockedevery8d,\n\tblockedevery9d,\n\tblockedevery10d // 8\n];\nvar BLOCKED_ACCESSOR_EVERY = [\n\tblockedaccessorevery2d, // 0\n\tblockedaccessorevery3d,\n\tblockedaccessorevery4d,\n\tblockedaccessorevery5d,\n\tblockedaccessorevery6d,\n\tblockedaccessorevery7d,\n\tblockedaccessorevery8d,\n\tblockedaccessorevery9d,\n\tblockedaccessorevery10d // 8\n];\nvar BLOCKED_COMPLEX_EVERY = [\n\tblockedcomplexevery2d, // 0\n\tblockedcomplexevery3d,\n\tblockedcomplexevery4d,\n\tblockedcomplexevery5d,\n\tblockedcomplexevery6d,\n\tblockedcomplexevery7d,\n\tblockedcomplexevery8d,\n\tblockedcomplexevery9d,\n\tblockedcomplexevery10d // 8\n];\nvar MAX_DIMS = EVERY.length - 1;\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* ## Notes\n*\n* - A provided ndarray should be an object with the following properties:\n*\n* - **dtype**: data type.\n* - **data**: data buffer.\n* - **shape**: dimensions.\n* - **strides**: stride lengths.\n* - **offset**: index offset.\n* - **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style).\n*\n* @param {ArrayLikeObject} arrays - array-like object containing one input array\n* @returns {boolean} result\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every( [ x ] );\n* // returns true\n*/\nfunction every( arrays ) {\n\tvar isCmplx;\n\tvar ndims;\n\tvar xmmv;\n\tvar shx;\n\tvar iox;\n\tvar len;\n\tvar sx;\n\tvar ox;\n\tvar ns;\n\tvar x;\n\tvar d;\n\tvar i;\n\n\t// Unpack the ndarray and standardize ndarray meta data:\n\tx = ndarray2object( arrays[ 0 ] );\n\tshx = x.shape;\n\tndims = shx.length;\n\n\t// Check for known array types which can be reinterpreted for better iteration performance...\n\tif ( isBooleanArray( x.data ) ) {\n\t\tx.data = reinterpretBoolean( x.data, 0 );\n\t\tx.accessorProtocol = false;\n\t} else if ( isComplexArray( x.data ) ) {\n\t\tx.data = reinterpretComplex( x.data, 0 );\n\t\tx.accessorProtocol = false;\n\t\tx.strides = gscal( ndims, 2, x.strides, 1 );\n\t\tx.offset *= 2;\n\t\tisCmplx = true;\n\t}\n\t// Determine whether we can avoid iteration altogether...\n\tif ( ndims === 0 ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t}\n\t\treturn EVERY[ ndims ]( x );\n\t}\n\t// Compute the number of elements and the number of singleton dimensions...\n\tlen = 1; // number of elements\n\tns = 0; // number of singleton dimensions\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\td = shx[ i ];\n\n\t\t// Note that, if one of the dimensions is `0`, the length will be `0`...\n\t\tlen *= d;\n\n\t\t// Check whether the current dimension is a singleton dimension...\n\t\tif ( d === 1 ) {\n\t\t\tns += 1;\n\t\t}\n\t}\n\t// Check whether we were provided an empty ndarray...\n\tif ( len === 0 ) {\n\t\treturn true;\n\t}\n\t// Determine whether the ndarray is one-dimensional and thus readily translates to a one-dimensional strided array...\n\tif ( ndims === 1 ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t}\n\t\treturn EVERY[ ndims ]( x );\n\t}\n\tsx = x.strides;\n\n\t// Determine whether the ndarray has only **one** non-singleton dimension (e.g., ndims=4, shape=[10,1,1,1]) so that we can treat an ndarray as being equivalent to a one-dimensional strided array...\n\tif ( ns === ndims-1 ) {\n\t\t// Get the index of the non-singleton dimension...\n\t\tfor ( i = 0; i < ndims; i++ ) {\n\t\t\tif ( shx[ i ] !== 1 ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tx.shape = [ shx[i] ];\n\t\tx.strides = [ sx[i] ];\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ 1 ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ 1 ]( x );\n\t\t}\n\t\treturn EVERY[ 1 ]( x );\n\t}\n\tiox = iterationOrder( sx ); // +/-1\n\n\t// Determine whether we can avoid blocked iteration...\n\tif ( iox !== 0 ) {\n\t\t// Determine the minimum and maximum linear indices which are accessible by the array view:\n\t\txmmv = minmaxViewBufferIndex( shx, sx, x.offset );\n\n\t\t// Determine whether we can ignore shape (and strides) and treat the ndarray as a linear one-dimensional strided array...\n\t\tif ( len === ( xmmv[1]-xmmv[0]+1 ) || ( isCmplx && len*2 === ( xmmv[1]-xmmv[0]+2 ) ) ) { // eslint-disable-line max-len\n\t\t\t// Note: the above is equivalent to @stdlib/ndarray/base/assert/is-contiguous, but in-lined so we can retain computed values...\n\t\t\tif ( iox === 1 ) {\n\t\t\t\tox = xmmv[ 0 ];\n\t\t\t} else {\n\t\t\t\tox = xmmv[ 1 ];\n\t\t\t}\n\t\t\tx.shape = [ len ];\n\t\t\tx.strides = [ ( isCmplx ) ? iox*2 : iox ];\n\t\t\tx.offset = ox;\n\t\t\tif ( x.accessorProtocol ) {\n\t\t\t\treturn ACCESSOR_EVERY[ 1 ]( x );\n\t\t\t}\n\t\t\tif ( isCmplx ) {\n\t\t\t\treturn COMPLEX_EVERY[ 1 ]( x );\n\t\t\t}\n\t\t\treturn EVERY[ 1 ]( x );\n\t\t}\n\t\t// The ndarray is non-contiguous, so we cannot directly use one-dimensional array functionality...\n\n\t\t// Determine whether we can use simple nested loops...\n\t\tif ( ndims <= MAX_DIMS ) {\n\t\t\t// So long as iteration always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration...\n\t\t\tif ( x.accessorProtocol ) {\n\t\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t\t}\n\t\t\tif ( isCmplx ) {\n\t\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t\t}\n\t\t\treturn EVERY[ ndims ]( x );\n\t\t}\n\t\t// Fall-through to blocked iteration...\n\t}\n\t// At this point, we're either dealing with a non-contiguous n-dimensional array or a high dimensional n-dimensional array, so our only hope is that we can still perform blocked iteration...\n\n\t// Determine whether we can perform blocked iteration...\n\tif ( ndims <= MAX_DIMS ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn BLOCKED_ACCESSOR_EVERY[ ndims-2 ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn BLOCKED_COMPLEX_EVERY[ ndims-2 ]( x );\n\t\t}\n\t\treturn BLOCKED_EVERY[ ndims-2 ]( x );\n\t}\n\t// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...\n\tif ( x.accessorProtocol ) {\n\t\treturn accessoreverynd( x );\n\t}\n\tif ( isCmplx ) {\n\t\treturn complexeverynd( x );\n\t}\n\treturn everynd( x );\n}\n\n\n// EXPORTS //\n\nmodule.exports = every;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @module @stdlib/ndarray-base-every\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var every = require( '@stdlib/ndarray-base-every' );\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every( [ x ] );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "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AClBC,GAAkB,KAClBC,GAAkB,KAClBC,GAAkB,KAClBC,GAAkB,KAClBC,GAAmB,KACnBC,GAAkB,KAClBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAiB,KACjBC,GAAkB,KAClBC,GAAiB,KACjBC,GAAU,KACVC,GAAU,KACVC,GAAU,KACVC,GAAU,KACVC,GAAU,KACVC,GAAU,KACVC,GAAU,KACVC,GAAU,KACVC,GAAU,KACVC,GAAU,KACVC,GAAW,KACXC,GAAU,KAKVC,GAAQ,CACXZ,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACD,EACIG,GAAiB,CACpBrC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACD,EACI4B,GAAgB,CACnB1B,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACD,EACIiB,GAAgB,CACnBhD,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACD,EACIyC,GAAyB,CAC5BnE,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACD,EACI4D,GAAwB,CAC3B3D,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACD,EACIoD,GAAWN,GAAM,OAAS,EAmD9B,SAASO,GAAOC,EAAS,CACxB,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAmBJ,GAhBAF,EAAIrF,GAAgB2E,EAAQ,CAAE,CAAE,EAChCI,EAAMM,EAAE,MACRR,EAAQE,EAAI,OAGPlF,GAAgBwF,EAAE,IAAK,GAC3BA,EAAE,KAAOnF,GAAoBmF,EAAE,KAAM,CAAE,EACvCA,EAAE,iBAAmB,IACVzF,GAAgByF,EAAE,IAAK,IAClCA,EAAE,KAAOpF,GAAoBoF,EAAE,KAAM,CAAE,EACvCA,EAAE,iBAAmB,GACrBA,EAAE,QAAUlF,GAAO0E,EAAO,EAAGQ,EAAE,QAAS,CAAE,EAC1CA,EAAE,QAAU,EACZT,EAAU,IAGNC,IAAU,EACd,OAAKQ,EAAE,iBACCjB,GAAgBS,CAAM,EAAGQ,CAAE,EAE9BT,EACGP,GAAeQ,CAAM,EAAGQ,CAAE,EAE3BlB,GAAOU,CAAM,EAAGQ,CAAE,EAK1B,IAFAJ,EAAM,EACNG,EAAK,EACCG,EAAI,EAAGA,EAAIV,EAAOU,IACvBD,EAAIP,EAAKQ,CAAE,EAGXN,GAAOK,EAGFA,IAAM,IACVF,GAAM,GAIR,GAAKH,IAAQ,EACZ,MAAO,GAGR,GAAKJ,IAAU,EACd,OAAKQ,EAAE,iBACCjB,GAAgBS,CAAM,EAAGQ,CAAE,EAE9BT,EACGP,GAAeQ,CAAM,EAAGQ,CAAE,EAE3BlB,GAAOU,CAAM,EAAGQ,CAAE,EAK1B,GAHAH,EAAKG,EAAE,QAGFD,IAAOP,EAAM,EAAI,CAErB,IAAMU,EAAI,EAAGA,EAAIV,GACXE,EAAKQ,CAAE,IAAM,EADKA,IACvB,CAMD,OAFAF,EAAE,MAAQ,CAAEN,EAAIQ,CAAC,CAAE,EACnBF,EAAE,QAAU,CAAEH,EAAGK,CAAC,CAAE,EACfF,EAAE,iBACCjB,GAAgB,CAAE,EAAGiB,CAAE,EAE1BT,EACGP,GAAe,CAAE,EAAGgB,CAAE,EAEvBlB,GAAO,CAAE,EAAGkB,CAAE,CACtB,CAIA,GAHAL,EAAMlF,GAAgBoF,CAAG,EAGpBF,IAAQ,EAAI,CAKhB,GAHAF,EAAO/E,GAAuBgF,EAAKG,EAAIG,EAAE,MAAO,EAG3CJ,IAAUH,EAAK,CAAC,EAAEA,EAAK,CAAC,EAAE,GAASF,GAAWK,EAAI,IAAQH,EAAK,CAAC,EAAEA,EAAK,CAAC,EAAE,EAU9E,OARKE,IAAQ,EACZG,EAAKL,EAAM,CAAE,EAEbK,EAAKL,EAAM,CAAE,EAEdO,EAAE,MAAQ,CAAEJ,CAAI,EAChBI,EAAE,QAAU,CAAIT,EAAYI,EAAI,EAAIA,CAAI,EACxCK,EAAE,OAASF,EACNE,EAAE,iBACCjB,GAAgB,CAAE,EAAGiB,CAAE,EAE1BT,EACGP,GAAe,CAAE,EAAGgB,CAAE,EAEvBlB,GAAO,CAAE,EAAGkB,CAAE,EAKtB,GAAKR,GAASJ,GAEb,OAAKY,EAAE,iBACCjB,GAAgBS,CAAM,EAAGQ,CAAE,EAE9BT,EACGP,GAAeQ,CAAM,EAAGQ,CAAE,EAE3BlB,GAAOU,CAAM,EAAGQ,CAAE,CAG3B,CAIA,OAAKR,GAASJ,GACRY,EAAE,iBACCd,GAAwBM,EAAM,CAAE,EAAGQ,CAAE,EAExCT,EACGJ,GAAuBK,EAAM,CAAE,EAAGQ,CAAE,EAErCf,GAAeO,EAAM,CAAE,EAAGQ,CAAE,EAG/BA,EAAE,iBACC3C,GAAiB2C,CAAE,EAEtBT,EACGtB,GAAgB+B,CAAE,EAEnBnB,GAASmB,CAAE,CACnB,CAKA1F,GAAO,QAAU+E,KC5TjB,IAAIc,GAAO,KAKX,OAAO,QAAUA", - "names": ["require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery2d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "ox1", "sh", "s0", "s1", "sx", "ox", "ix", "i0", "i1", "j0", "j1", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery3d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "dx2", "ox1", "ox2", "sh", "s0", "s1", "s2", "sx", "ox", "ix", "i0", "i1", "i2", "j0", "j1", "j2", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery4d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "ox1", "ox2", "ox3", "sh", "s0", "s1", "s2", "s3", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "j0", "j1", "j2", "j3", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery5d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "ox1", "ox2", "ox3", "ox4", "sh", "s0", "s1", "s2", "s3", "s4", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "j0", "j1", "j2", "j3", "j4", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery6d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "ox1", "ox2", "ox3", "ox4", "ox5", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "j0", "j1", "j2", "j3", "j4", "j5", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery7d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery8d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery9d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "o", "require_d_blocked_accessors", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery10d", "x", "bsize", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "ox9", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "j9", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery2d", "x", "bsize", "xbuf", "dx0", "dx1", "ox1", "sh", "s0", "s1", "sx", "ox", "ix", "i0", "i1", "j0", "j1", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery3d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "ox1", "ox2", "sh", "s0", "s1", "s2", "sx", "ox", "ix", "i0", "i1", "i2", "j0", "j1", "j2", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery4d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "ox1", "ox2", "ox3", "sh", "s0", "s1", "s2", "s3", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "j0", "j1", "j2", "j3", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery5d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "ox1", "ox2", "ox3", "ox4", "sh", "s0", "s1", "s2", "s3", "s4", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "j0", "j1", "j2", "j3", "j4", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery6d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "ox1", "ox2", "ox3", "ox4", "ox5", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "j0", "j1", "j2", "j3", "j4", "j5", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery7d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery8d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery9d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "o", "require_d_blocked_complex", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery10d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "ox9", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "j9", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery2d", "x", "bsize", "xbuf", "dx0", "dx1", "ox1", "sh", "s0", "s1", "sx", "ox", "ix", "i0", "i1", "j0", "j1", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery3d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "ox1", "ox2", "sh", "s0", "s1", "s2", "sx", "ox", "ix", "i0", "i1", "i2", "j0", "j1", "j2", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery4d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "ox1", "ox2", "ox3", "sh", "s0", "s1", "s2", "s3", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "j0", "j1", "j2", "j3", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery5d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "ox1", "ox2", "ox3", "ox4", "sh", "s0", "s1", "s2", "s3", "s4", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "j0", "j1", "j2", "j3", "j4", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery6d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "ox1", "ox2", "ox3", "ox4", "ox5", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "j0", "j1", "j2", "j3", "j4", "j5", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery7d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery8d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery9d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "o", "require_d_blocked", "__commonJSMin", "exports", "module", "loopOrder", "blockSize", "blockedevery10d", "x", "bsize", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "ox1", "ox2", "ox3", "ox4", "ox5", "ox6", "ox7", "ox8", "ox9", "sh", "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "sx", "ox", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "j0", "j1", "j2", "j3", "j4", "j5", "j6", "j7", "j8", "j9", "o", "require_d_accessors", "__commonJSMin", "exports", "module", "every0d", "x", "require_d_accessors", "__commonJSMin", "exports", "module", "every1d", "x", "xbuf", "get", "dx0", "S0", "ix", "i0", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every2d", "x", "xbuf", "get", "dx0", "dx1", "sh", "S0", "S1", "sx", "ix", "i0", "i1", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every3d", "x", "xbuf", "get", "dx0", "dx1", "dx2", "sh", "S0", "S1", "S2", "sx", "ix", "i0", "i1", "i2", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every4d", "x", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "sh", "S0", "S1", "S2", "S3", "sx", "ix", "i0", "i1", "i2", "i3", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every5d", "x", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "sh", "S0", "S1", "S2", "S3", "S4", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every6d", "x", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every7d", "x", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every8d", "x", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every9d", "x", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "require_d_accessors", "__commonJSMin", "exports", "module", "strides2order", "every10d", "x", "xbuf", "get", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "require_nd_accessors", "__commonJSMin", "exports", "module", "numel", "vind2bind", "MODE", "everynd", "x", "xbuf", "ordx", "len", "get", "sh", "sx", "ox", "ix", "i", "require_d_complex", "__commonJSMin", "exports", "module", "every0d", "x", "require_d_complex", "__commonJSMin", "exports", "module", "every1d", "x", "xbuf", "dx0", "S0", "ix", "i0", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every2d", "x", "xbuf", "dx0", "dx1", "sh", "S0", "S1", "sx", "ix", "i0", "i1", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every3d", "x", "xbuf", "dx0", "dx1", "dx2", "sh", "S0", "S1", "S2", "sx", "ix", "i0", "i1", "i2", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every4d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "sh", "S0", "S1", "S2", "S3", "sx", "ix", "i0", "i1", "i2", "i3", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every5d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "sh", "S0", "S1", "S2", "S3", "S4", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every6d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every7d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every8d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every9d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "require_d_complex", "__commonJSMin", "exports", "module", "strides2order", "every10d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "require_nd_complex", "__commonJSMin", "exports", "module", "numel", "vind2bind", "MODE", "everynd", "x", "xbuf", "ordx", "len", "sh", "sx", "ox", "ix", "i", "require_d", "__commonJSMin", "exports", "module", "every0d", "x", "require_d", "__commonJSMin", "exports", "module", "every1d", "x", "xbuf", "dx0", "S0", "ix", "i0", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every2d", "x", "xbuf", "dx0", "dx1", "sh", "S0", "S1", "sx", "ix", "i0", "i1", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every3d", "x", "xbuf", "dx0", "dx1", "dx2", "sh", "S0", "S1", "S2", "sx", "ix", "i0", "i1", "i2", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every4d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "sh", "S0", "S1", "S2", "S3", "sx", "ix", "i0", "i1", "i2", "i3", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every5d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "sh", "S0", "S1", "S2", "S3", "S4", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every6d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every7d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every8d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every9d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "require_d", "__commonJSMin", "exports", "module", "strides2order", "every10d", "x", "xbuf", "dx0", "dx1", "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", "dx8", "dx9", "sh", "S0", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "sx", "ix", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "require_nd", "__commonJSMin", "exports", "module", "numel", "vind2bind", "MODE", "everynd", "x", "xbuf", "ordx", "len", "sh", "sx", "ox", "ix", "i", "require_main", "__commonJSMin", "exports", "module", "isComplexArray", "isBooleanArray", "iterationOrder", "minmaxViewBufferIndex", "ndarray2object", "reinterpretComplex", "reinterpretBoolean", "gscal", "blockedaccessorevery2d", "blockedaccessorevery3d", "blockedaccessorevery4d", "blockedaccessorevery5d", "blockedaccessorevery6d", "blockedaccessorevery7d", "blockedaccessorevery8d", "blockedaccessorevery9d", "blockedaccessorevery10d", "blockedcomplexevery2d", "blockedcomplexevery3d", "blockedcomplexevery4d", "blockedcomplexevery5d", "blockedcomplexevery6d", "blockedcomplexevery7d", "blockedcomplexevery8d", "blockedcomplexevery9d", "blockedcomplexevery10d", "blockedevery2d", "blockedevery3d", "blockedevery4d", "blockedevery5d", "blockedevery6d", "blockedevery7d", "blockedevery8d", "blockedevery9d", "blockedevery10d", "accessorevery0d", "accessorevery1d", "accessorevery2d", "accessorevery3d", "accessorevery4d", "accessorevery5d", "accessorevery6d", "accessorevery7d", "accessorevery8d", "accessorevery9d", "accessorevery10d", "accessoreverynd", "complexevery0d", "complexevery1d", "complexevery2d", "complexevery3d", "complexevery4d", "complexevery5d", "complexevery6d", "complexevery7d", "complexevery8d", "complexevery9d", "complexevery10d", "complexeverynd", "every0d", "every1d", "every2d", "every3d", "every4d", "every5d", "every6d", "every7d", "every8d", "every9d", "every10d", "everynd", "EVERY", "ACCESSOR_EVERY", "COMPLEX_EVERY", "BLOCKED_EVERY", "BLOCKED_ACCESSOR_EVERY", "BLOCKED_COMPLEX_EVERY", "MAX_DIMS", "every", "arrays", "isCmplx", "ndims", "xmmv", "shx", "iox", "len", "sx", "ox", "ns", "x", "d", "i", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index 3d38181..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,55 +0,0 @@ - -{{alias}}( arrays ) - Tests whether every element in an ndarray is truthy. - - A provided "ndarray" should be an object with the following properties: - - - dtype: data type. - - data: data buffer. - - shape: dimensions. - - strides: stride lengths. - - offset: index offset. - - order: specifies whether an ndarray is row-major (C-style) or column-major - (Fortran-style). - - Parameters - ---------- - arrays: ArrayLikeObject - Array-like object containing an input ndarray. - - Returns - ------- - out: boolean - Boolean indicating whether every element in an ndarray is truthy. - - Examples - -------- - // Define ndarray data and meta data... - > var xbuf = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0, 1.0, 1.0 ] ); - > var dtype = 'float64'; - > var shape = [ 2, 2 ]; - > var sx = [ 2, 1 ]; - > var ox = 0; - > var order = 'row-major'; - - // Using an ndarray... - > var x = {{alias:@stdlib/ndarray/ctor}}( dtype, xbuf, shape, sx, ox, order ); - > {{alias}}( [ x ] ) - true - - // Using a minimal ndarray-like object... - > xbuf = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0, 1.0, 0.0 ] ); - > x = { - ... 'dtype': dtype, - ... 'data': xbuf, - ... 'shape': shape, - ... 'strides': sx, - ... 'offset': ox, - ... 'order': order - ... }; - > {{alias}}( [ x ] ) - false - - See Also - -------- - diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts deleted file mode 100644 index 214d31d..0000000 --- a/docs/types/index.d.ts +++ /dev/null @@ -1,60 +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. -*/ - -// TypeScript Version: 4.1 - -/// - -import { ArrayLike } from '@stdlib/types/array'; -import { ndarray } from '@stdlib/types/ndarray'; - -/** -* Tests whether every element in an ndarray is truthy. -* -* @param arrays - array-like object containing an input ndarray -* @returns boolean indicating whether every element is truthy -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray: -* var x = ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' ); -* -* // Test elements: -* var out = every( [ x ] ); -* // returns true -*/ -declare function every( arrays: ArrayLike ): boolean; - - -// EXPORTS // - -export = every; diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 45fd825..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,54 +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. -*/ - -/// - -import zeros = require( '@stdlib/ndarray-zeros' ); -import every = require( './index' ); - - -// TESTS // - -// The function returns a boolean... -{ - const x = zeros( [ 2, 2 ] ); - const arrays = [ x ]; - - every( arrays ); // $ExpectType boolean -} - -// The compiler throws an error if the function is provided a first argument which is not an array-like object containing ndarray-like objects... -{ - every( 5 ); // $ExpectError - every( true ); // $ExpectError - every( false ); // $ExpectError - every( null ); // $ExpectError - every( undefined ); // $ExpectError - every( {} ); // $ExpectError - every( [ 1 ] ); // $ExpectError - every( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const x = zeros( [ 2, 2 ] ); - const arrays = [ x ]; - - every(); // $ExpectError - every( arrays, 10 ); // $ExpectError -} diff --git a/examples/c/b_x/Makefile b/examples/c/b_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/b_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/b_x/example.c b/examples/c/b_x/example.c deleted file mode 100644 index f54bdf9..0000000 --- a/examples/c/b_x/example.c +++ /dev/null @@ -1,110 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - uint8_t xbuf[] = { 1, 2, 3, 4, 0, 6, 7, 8 }; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 4, 2, 1 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_b_x( arrays, NULL ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/c_x/Makefile b/examples/c/c_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/c_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/c_x/example.c b/examples/c/c_x/example.c deleted file mode 100644 index 3d6e0c8..0000000 --- a/examples/c/c_x/example.c +++ /dev/null @@ -1,123 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - stdlib_complex64_t xvalues[] = { - stdlib_complex64( 1.0f, 2.0f ), - stdlib_complex64( 2.0f, 0.0f ), - stdlib_complex64( 3.0f, 0.0f ), - stdlib_complex64( 4.0f, 0.0f ), - stdlib_complex64( 0.0f, 0.0f ), - stdlib_complex64( 6.0f, 0.0f ), - stdlib_complex64( 7.0f, 0.0f ), - stdlib_complex64( 8.0f, 0.0f ) - }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 32, 16, 8 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_c_x( arrays, NULL ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/c_x_as_z_x/Makefile b/examples/c/c_x_as_z_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/c_x_as_z_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/c_x_as_z_x/example.c b/examples/c/c_x_as_z_x/example.c deleted file mode 100644 index e31751f..0000000 --- a/examples/c/c_x_as_z_x/example.c +++ /dev/null @@ -1,129 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -static bool fcn( const stdlib_complex128_t x ) { - return ( stdlib_complex128_real( x ) > 0.0 && stdlib_complex128_imag( x ) > 0.0 ); -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - stdlib_complex64_t xvalues[] = { - stdlib_complex64( 1.0f, 1.0f ), - stdlib_complex64( 2.0f, 2.0f ), - stdlib_complex64( 3.0f, 3.0f ), - stdlib_complex64( 4.0f, 4.0f ), - stdlib_complex64( 5.0f, 5.0f ), - stdlib_complex64( 6.0f, 6.0f ), - stdlib_complex64( 7.0f, 7.0f ), - stdlib_complex64( 8.0f, 0.0f ) - }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 32, 16, 8 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_by_c_x_as_z_x( arrays, (void *)fcn ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/d_x/Makefile b/examples/c/d_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/d_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/d_x/example.c b/examples/c/d_x/example.c deleted file mode 100644 index 8d6e967..0000000 --- a/examples/c/d_x/example.c +++ /dev/null @@ -1,113 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - double xvalues[] = { 1.0, 2.0, 3.0, 4.0, 0.0, 6.0, 7.0, 8.0 }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 32, 16, 8 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_d_x( arrays, NULL ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/f_x/Makefile b/examples/c/f_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/f_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/f_x/example.c b/examples/c/f_x/example.c deleted file mode 100644 index c52f591..0000000 --- a/examples/c/f_x/example.c +++ /dev/null @@ -1,113 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - float xvalues[] = { 1.0f, 2.0f, 3.0f, 4.0f, 0.0f/0.0f, 6.0f, 7.0f, 8.0f }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 16, 8, 4 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_f_x( arrays, NULL ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/i_x/Makefile b/examples/c/i_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/i_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/i_x/example.c b/examples/c/i_x/example.c deleted file mode 100644 index 5dd1c75..0000000 --- a/examples/c/i_x/example.c +++ /dev/null @@ -1,113 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - int32_t xvalues[] = { 1, 2, 3, 4, 0, 6, 7, 8 }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 16, 8, 4 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_i_x( arrays, NULL ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/k_x_as_i_x/Makefile b/examples/c/k_x_as_i_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/k_x_as_i_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/k_x_as_i_x/example.c b/examples/c/k_x_as_i_x/example.c deleted file mode 100644 index 00c7a92..0000000 --- a/examples/c/k_x_as_i_x/example.c +++ /dev/null @@ -1,117 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -static bool fcn( const int32_t x ) { - return ( x >= 0 ); -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - int16_t xvalues[] = { 1, 2, 3, 4, 0, 6, 7, 8 }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 8, 4, 2 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_by_k_x_as_i_x( arrays, (void *)fcn ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/s_x/Makefile b/examples/c/s_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/s_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/s_x/example.c b/examples/c/s_x/example.c deleted file mode 100644 index fae0b48..0000000 --- a/examples/c/s_x/example.c +++ /dev/null @@ -1,117 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -static bool fcn( const int8_t x ) { - return ( x >= 0 ); -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - int8_t xvalues[] = { 1, 2, 3, 4, 0, 6, 7, 8 }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 4, 2, 1 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_by_s_x( arrays, (void *)fcn ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/t_x_as_u_x/Makefile b/examples/c/t_x_as_u_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/t_x_as_u_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/t_x_as_u_x/example.c b/examples/c/t_x_as_u_x/example.c deleted file mode 100644 index d795fd1..0000000 --- a/examples/c/t_x_as_u_x/example.c +++ /dev/null @@ -1,117 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -static bool fcn( const uint32_t x ) { - return ( x >= 1 ); -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - uint16_t xvalues[] = { 1, 2, 3, 4, 0, 6, 7, 8 }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 8, 4, 2 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_by_t_x_as_u_x( arrays, (void *)fcn ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/u_x/Makefile b/examples/c/u_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/u_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/u_x/example.c b/examples/c/u_x/example.c deleted file mode 100644 index f115131..0000000 --- a/examples/c/u_x/example.c +++ /dev/null @@ -1,113 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - uint32_t xvalues[] = { 1, 2, 3, 4, 0, 6, 7, 8 }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 16, 8, 4 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_u_x( arrays, NULL ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/c/z_x/Makefile b/examples/c/z_x/Makefile deleted file mode 100644 index 3441b6e..0000000 --- a/examples/c/z_x/Makefile +++ /dev/null @@ -1,148 +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. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - -# Define the program used for compiling C source files: -ifdef C_COMPILER - CC := $(C_COMPILER) -else - CC := gcc -endif - -# Define the command-line options when compiling C files: -CFLAGS ?= \ - -std=c99 \ - -O3 \ - -Wall \ - -pedantic \ - -march=native \ - -flto - -# Determine whether to generate position independent code ([1][1], [2][2]). -# -# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options -# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option -ifeq ($(OS), WINNT) - fPIC ?= -else - fPIC ?= -fPIC -endif - -# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): -INCLUDE ?= - -# List of source files: -SOURCE_FILES ?= - -# List of libraries (e.g., `-lopenblas -lpthread`): -LIBRARIES ?= - -# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): -LIBPATH ?= - -# List of C targets: -c_targets := example.out - - -# RULES # - -#/ -# Compiles source files. -# -# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) -# @param {string} [CFLAGS] - C compiler options -# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) -# @param {string} [SOURCE_FILES] - list of source files -# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) -# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) -# -# @example -# make -# -# @example -# make all -#/ -all: $(c_targets) - -.PHONY: all - -#/ -# Compiles C source files. -# -# @private -# @param {string} CC - C compiler (e.g., `gcc`) -# @param {string} CFLAGS - C compiler options -# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) -# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) -# @param {string} SOURCE_FILES - list of source files -# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) -# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) -#/ -$(c_targets): %.out: %.c - $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) - -#/ -# Runs compiled examples. -# -# @example -# make run -#/ -run: $(c_targets) - $(QUIET) ./$< - -.PHONY: run - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: - $(QUIET) -rm -f *.o *.out - -.PHONY: clean diff --git a/examples/c/z_x/example.c b/examples/c/z_x/example.c deleted file mode 100644 index e671d62..0000000 --- a/examples/c/z_x/example.c +++ /dev/null @@ -1,123 +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. -*/ - -#include "stdlib/ndarray/base/every.h" -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include -#include -#include -#include - -static void print_ndarray_contents( const struct ndarray *x ) { - int64_t i; - int8_t s; - bool v; - - for ( i = 0; i < stdlib_ndarray_length( x ); i++ ) { - s = stdlib_ndarray_iget_bool( x, i, &v ); - if ( s != 0 ) { - fprintf( stderr, "Unable to resolve data element.\n" ); - exit( EXIT_FAILURE ); - } - fprintf( stdout, "data[%"PRId64"] = %s\n", i, ( v ) ? "true" : "false" ); - } -} - -int main( void ) { - // Define the ndarray data types: - enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; - enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - - // Create underlying byte arrays: - stdlib_complex128_t xvalues[] = { - stdlib_complex128( 1.0, 2.0 ), - stdlib_complex128( 2.0, 0.0 ), - stdlib_complex128( 3.0, 0.0 ), - stdlib_complex128( 4.0, 0.0 ), - stdlib_complex128( 0.0, 1.0 ), - stdlib_complex128( 6.0, 0.0 ), - stdlib_complex128( 7.0, 0.0 ), - stdlib_complex128( 8.0, 0.0 ) - }; - - // cppcheck-suppress invalidPointerCast - uint8_t *xbuf = (uint8_t *)xvalues; - uint8_t ybuf[] = { 0 }; - - // Define the number of dimensions: - int64_t ndims = 3; - - // Define the array shapes: - int64_t shx[] = { 2, 2, 2 }; - int64_t *shy = NULL; - - // Define the strides: - int64_t sx[] = { 64, 32, 16 }; - int64_t sy[] = { 0 }; - - // Define the offsets: - int64_t ox = 0; - int64_t oy = 0; - - // Define the array order: - enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - - // Specify the index mode: - enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - - // Specify the subscript index modes: - int8_t submodes[] = { imode }; - int64_t nsubmodes = 1; - - // Create an input ndarray: - struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); - if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Create an output ndarray: - struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); - if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); - } - - // Define an array containing the ndarrays: - struct ndarray *arrays[] = { x, y }; - - // Test elements: - int8_t status = stdlib_ndarray_every_z_x( arrays, NULL ); - if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); - } - - // Print the results: - print_ndarray_contents( y ); - fprintf( stdout, "\n" ); - - // Free allocated memory: - stdlib_ndarray_free( x ); - stdlib_ndarray_free( y ); -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index b7cb835..0000000 --- a/examples/index.js +++ /dev/null @@ -1,38 +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'; - -var bernoulli = require( '@stdlib/random-array-bernoulli' ); -var ndarray2array = require( '@stdlib/ndarray-base-to-array' ); -var every = require( './../lib' ); - -var x = { - 'dtype': 'generic', - 'data': bernoulli( 10, 0.9, { - 'dtype': 'generic' - }), - 'shape': [ 5, 2 ], - 'strides': [ 2, 1 ], - 'offset': 0, - 'order': 'row-major' -}; -console.log( ndarray2array( x.data, x.shape, x.strides, x.offset, x.order ) ); - -var out = every( [ x ] ); -console.log( out ); diff --git a/include/stdlib/ndarray/base/every.h b/include/stdlib/ndarray/base/every.h deleted file mode 100644 index c56df77..0000000 --- a/include/stdlib/ndarray/base/every.h +++ /dev/null @@ -1,116 +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. -*/ - -/** -* Header file containing function declarations for ndarray functions. -*/ -#ifndef STDLIB_NDARRAY_BASE_EVERY_H -#define STDLIB_NDARRAY_BASE_EVERY_H - -#include "every/macros.h" -#include "every/typedefs.h" -#include "every/dispatch_object.h" -#include "every/dispatch.h" - -/* -* The following is auto-generated. Do not manually edit. See scripts/loops.js. -*/ - -// BEGIN INLINE LOOPS -#include "every/inline/b_x.h" - -#include "every/inline/c_x.h" - -#include "every/inline/d_x.h" - -#include "every/inline/f_x.h" - -#include "every/inline/i_x.h" - -#include "every/inline/k_x.h" - -#include "every/inline/s_x.h" - -#include "every/inline/t_x.h" - -#include "every/inline/u_x.h" - -#include "every/inline/x_x.h" - -#include "every/inline/z_x.h" -// END INLINE LOOPS - -// BEGIN PREDICATE LOOPS -#include "every/predicate/b_x.h" -#include "every/predicate/b_x_as_c_x.h" -#include "every/predicate/b_x_as_d_x.h" -#include "every/predicate/b_x_as_f_x.h" -#include "every/predicate/b_x_as_i_x.h" -#include "every/predicate/b_x_as_k_x.h" -#include "every/predicate/b_x_as_t_x.h" -#include "every/predicate/b_x_as_u_x.h" -#include "every/predicate/b_x_as_z_x.h" - -#include "every/predicate/c_x.h" -#include "every/predicate/c_x_as_z_x.h" - -#include "every/predicate/d_x.h" -#include "every/predicate/d_x_as_z_x.h" - -#include "every/predicate/f_x.h" -#include "every/predicate/f_x_as_c_x.h" -#include "every/predicate/f_x_as_d_x.h" -#include "every/predicate/f_x_as_z_x.h" - -#include "every/predicate/i_x.h" -#include "every/predicate/i_x_as_d_x.h" -#include "every/predicate/i_x_as_z_x.h" - -#include "every/predicate/k_x.h" -#include "every/predicate/k_x_as_c_x.h" -#include "every/predicate/k_x_as_d_x.h" -#include "every/predicate/k_x_as_f_x.h" -#include "every/predicate/k_x_as_i_x.h" -#include "every/predicate/k_x_as_z_x.h" - -#include "every/predicate/s_x.h" -#include "every/predicate/s_x_as_c_x.h" -#include "every/predicate/s_x_as_d_x.h" -#include "every/predicate/s_x_as_f_x.h" -#include "every/predicate/s_x_as_i_x.h" -#include "every/predicate/s_x_as_k_x.h" -#include "every/predicate/s_x_as_z_x.h" - -#include "every/predicate/t_x.h" -#include "every/predicate/t_x_as_c_x.h" -#include "every/predicate/t_x_as_d_x.h" -#include "every/predicate/t_x_as_f_x.h" -#include "every/predicate/t_x_as_i_x.h" -#include "every/predicate/t_x_as_u_x.h" -#include "every/predicate/t_x_as_z_x.h" - -#include "every/predicate/u_x.h" -#include "every/predicate/u_x_as_d_x.h" -#include "every/predicate/u_x_as_z_x.h" - -#include "every/predicate/x_x.h" - -#include "every/predicate/z_x.h" -// END PREDICATE LOOPS - -#endif // !STDLIB_NDARRAY_BASE_EVERY_H diff --git a/include/stdlib/ndarray/base/every/dispatch.h b/include/stdlib/ndarray/base/every/dispatch.h deleted file mode 100644 index 4f74b76..0000000 --- a/include/stdlib/ndarray/base/every/dispatch.h +++ /dev/null @@ -1,42 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_DISPATCH_H -#define STDLIB_NDARRAY_BASE_EVERY_DISPATCH_H - -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Dispatches to an ndarray function according to the dimensionality of a provided ndarray argument. -*/ -int8_t stdlib_ndarray_every_dispatch( const struct ndarrayEveryDispatchObject *obj, struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_DISPATCH_H diff --git a/include/stdlib/ndarray/base/every/dispatch_object.h b/include/stdlib/ndarray/base/every/dispatch_object.h deleted file mode 100644 index 58d4ca2..0000000 --- a/include/stdlib/ndarray/base/every/dispatch_object.h +++ /dev/null @@ -1,94 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_DISPATCH_OBJECT_H -#define STDLIB_NDARRAY_BASE_EVERY_DISPATCH_OBJECT_H - -#include "stdlib/ndarray/base/every/typedefs.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Structure for grouping function dispatch information. -* -* @example -* #include "stdlib/ndarray/base/every/b.h" -* #include -* #include -* -* ndarrayEveryFcn functions[] = { -* stdlib_ndarray_every_b_x_0d, -* stdlib_ndarray_every_b_x_1d, -* stdlib_ndarray_every_b_x_2d, -* stdlib_ndarray_every_b_x_3d, -* stdlib_ndarray_every_b_x_4d, -* stdlib_ndarray_every_b_x_5d, -* stdlib_ndarray_every_b_x_6d, -* stdlib_ndarray_every_b_x_7d, -* stdlib_ndarray_every_b_x_8d, -* stdlib_ndarray_every_b_x_9d, -* stdlib_ndarray_every_b_x_10d -* stdlib_ndarray_every_b_x_nd -* }; - -* ndarrayEveryFcn blocked_functions[] = { -* stdlib_ndarray_every_b_x_2d_blocked, -* stdlib_ndarray_every_b_x_3d_blocked, -* stdlib_ndarray_every_b_x_4d_blocked, -* stdlib_ndarray_every_b_x_5d_blocked, -* stdlib_ndarray_every_b_x_6d_blocked, -* stdlib_ndarray_every_b_x_7d_blocked, -* stdlib_ndarray_every_b_x_8d_blocked, -* stdlib_ndarray_every_b_x_9d_blocked, -* stdlib_ndarray_every_b_x_10d_blocked -* }; -* -* ndarrayEveryDispatchObject obj = { -* functions, -* 12, -* blocked_functions -* 9 -* }; -* -* // ... -*/ -struct ndarrayEveryDispatchObject { - // Array containing ndarray functions for performing element-wise computation: - ndarrayEveryFcn *functions; - - // Number of ndarray functions: - int32_t nfunctions; - - // Array containing ndarray functions for performing element-wise computation using loop blocking: - ndarrayEveryFcn *blocked_functions; - - // Number of blocked ndarray functions: - int32_t nblockedfunctions; -}; - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_DISPATCH_OBJECT_H diff --git a/include/stdlib/ndarray/base/every/inline/b_x.h b/include/stdlib/ndarray/base/every/inline/b_x.h deleted file mode 100644 index bf9a55e..0000000 --- a/include/stdlib/ndarray/base/every/inline/b_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_B_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_B_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_b_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_B_X_H diff --git a/include/stdlib/ndarray/base/every/inline/c_x.h b/include/stdlib/ndarray/base/every/inline/c_x.h deleted file mode 100644 index e4989bd..0000000 --- a/include/stdlib/ndarray/base/every/inline/c_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_C_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_C_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_c_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_C_X_H diff --git a/include/stdlib/ndarray/base/every/inline/d_x.h b/include/stdlib/ndarray/base/every/inline/d_x.h deleted file mode 100644 index 1d9f081..0000000 --- a/include/stdlib/ndarray/base/every/inline/d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_d_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_D_X_H diff --git a/include/stdlib/ndarray/base/every/inline/f_x.h b/include/stdlib/ndarray/base/every/inline/f_x.h deleted file mode 100644 index df16a1f..0000000 --- a/include/stdlib/ndarray/base/every/inline/f_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_F_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_F_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_f_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_F_X_H diff --git a/include/stdlib/ndarray/base/every/inline/i_x.h b/include/stdlib/ndarray/base/every/inline/i_x.h deleted file mode 100644 index ed5277b..0000000 --- a/include/stdlib/ndarray/base/every/inline/i_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_I_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_I_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_i_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_I_X_H diff --git a/include/stdlib/ndarray/base/every/inline/k_x.h b/include/stdlib/ndarray/base/every/inline/k_x.h deleted file mode 100644 index 1916919..0000000 --- a/include/stdlib/ndarray/base/every/inline/k_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_K_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_K_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_k_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_K_X_H diff --git a/include/stdlib/ndarray/base/every/inline/s_x.h b/include/stdlib/ndarray/base/every/inline/s_x.h deleted file mode 100644 index fc40784..0000000 --- a/include/stdlib/ndarray/base/every/inline/s_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_S_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_S_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_s_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_S_X_H diff --git a/include/stdlib/ndarray/base/every/inline/t_x.h b/include/stdlib/ndarray/base/every/inline/t_x.h deleted file mode 100644 index bd8d9e3..0000000 --- a/include/stdlib/ndarray/base/every/inline/t_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_T_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_T_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_t_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_T_X_H diff --git a/include/stdlib/ndarray/base/every/inline/u_x.h b/include/stdlib/ndarray/base/every/inline/u_x.h deleted file mode 100644 index 5599717..0000000 --- a/include/stdlib/ndarray/base/every/inline/u_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_U_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_U_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_u_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_U_X_H diff --git a/include/stdlib/ndarray/base/every/inline/x_x.h b/include/stdlib/ndarray/base/every/inline/x_x.h deleted file mode 100644 index 144cc99..0000000 --- a/include/stdlib/ndarray/base/every/inline/x_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_X_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_X_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_x_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_X_X_H diff --git a/include/stdlib/ndarray/base/every/inline/z_x.h b/include/stdlib/ndarray/base/every/inline/z_x.h deleted file mode 100644 index c0eaa83..0000000 --- a/include/stdlib/ndarray/base/every/inline/z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_z_x_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_Z_X_H diff --git a/include/stdlib/ndarray/base/every/internal/permute.h b/include/stdlib/ndarray/base/every/internal/permute.h deleted file mode 100644 index e693f6c..0000000 --- a/include/stdlib/ndarray/base/every/internal/permute.h +++ /dev/null @@ -1,29 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INTERNAL_PERMUTE_H -#define STDLIB_NDARRAY_BASE_EVERY_INTERNAL_PERMUTE_H - -#include - -/** -* Permutes an input array according to a provided index array. -*/ -void stdlib_ndarray_base_every_internal_permute( const int64_t n, const int64_t *arr, const int64_t *idx, int64_t *out ); - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INTERNAL_PERMUTE_H diff --git a/include/stdlib/ndarray/base/every/internal/range.h b/include/stdlib/ndarray/base/every/internal/range.h deleted file mode 100644 index b426a74..0000000 --- a/include/stdlib/ndarray/base/every/internal/range.h +++ /dev/null @@ -1,29 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INTERNAL_RANGE_H -#define STDLIB_NDARRAY_BASE_EVERY_INTERNAL_RANGE_H - -#include - -/** -* Writes `n` evenly spaced values from `0` to `n-1` to an output array. -*/ -void stdlib_ndarray_base_every_internal_range( const int64_t n, int64_t *out ); - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INTERNAL_RANGE_H diff --git a/include/stdlib/ndarray/base/every/internal/sort2ins.h b/include/stdlib/ndarray/base/every/internal/sort2ins.h deleted file mode 100644 index 2766e19..0000000 --- a/include/stdlib/ndarray/base/every/internal/sort2ins.h +++ /dev/null @@ -1,29 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INTERNAL_SORT2INS_H -#define STDLIB_NDARRAY_BASE_EVERY_INTERNAL_SORT2INS_H - -#include - -/** -* Simultaneously sorts two arrays based on the sort order of the first array using insertion sort. -*/ -void stdlib_ndarray_base_every_internal_sort2ins( const int64_t n, int64_t *x, int64_t *y ); - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INTERNAL_SORT2INS_H diff --git a/include/stdlib/ndarray/base/every/macros.h b/include/stdlib/ndarray/base/every/macros.h deleted file mode 100644 index d830580..0000000 --- a/include/stdlib/ndarray/base/every/macros.h +++ /dev/null @@ -1,44 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/macros/1d.h" -#include "stdlib/ndarray/base/every/macros/2d.h" -#include "stdlib/ndarray/base/every/macros/2d_blocked.h" -#include "stdlib/ndarray/base/every/macros/3d.h" -#include "stdlib/ndarray/base/every/macros/3d_blocked.h" -#include "stdlib/ndarray/base/every/macros/4d.h" -#include "stdlib/ndarray/base/every/macros/4d_blocked.h" -#include "stdlib/ndarray/base/every/macros/5d.h" -#include "stdlib/ndarray/base/every/macros/5d_blocked.h" -#include "stdlib/ndarray/base/every/macros/6d.h" -#include "stdlib/ndarray/base/every/macros/6d_blocked.h" -#include "stdlib/ndarray/base/every/macros/7d.h" -#include "stdlib/ndarray/base/every/macros/7d_blocked.h" -#include "stdlib/ndarray/base/every/macros/8d.h" -#include "stdlib/ndarray/base/every/macros/8d_blocked.h" -#include "stdlib/ndarray/base/every/macros/9d.h" -#include "stdlib/ndarray/base/every/macros/9d_blocked.h" -#include "stdlib/ndarray/base/every/macros/10d.h" -#include "stdlib/ndarray/base/every/macros/10d_blocked.h" -#include "stdlib/ndarray/base/every/macros/nd.h" - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_H diff --git a/include/stdlib/ndarray/base/every/macros/10d.h b/include/stdlib/ndarray/base/every/macros/10d.h deleted file mode 100644 index 1728f71..0000000 --- a/include/stdlib/ndarray/base/every/macros/10d.h +++ /dev/null @@ -1,265 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_10D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_10D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of a ten-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_10D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_10D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_10D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t d6x1; \ - int64_t d7x1; \ - int64_t d8x1; \ - int64_t d9x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t S2; \ - int64_t S3; \ - int64_t S4; \ - int64_t S5; \ - int64_t S6; \ - int64_t S7; \ - int64_t S8; \ - int64_t S9; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t i6; \ - int64_t i7; \ - int64_t i8; \ - int64_t i9; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 9 ]; \ - S1 = shape[ 8 ]; \ - S2 = shape[ 7 ]; \ - S3 = shape[ 6 ]; \ - S4 = shape[ 5 ]; \ - S5 = shape[ 4 ]; \ - S6 = shape[ 3 ]; \ - S7 = shape[ 2 ]; \ - S8 = shape[ 1 ]; \ - S9 = shape[ 0 ]; \ - d0x1 = sx1[ 9 ]; \ - d1x1 = sx1[ 8 ] - ( S0*sx1[9] ); \ - d2x1 = sx1[ 7 ] - ( S1*sx1[8] ); \ - d3x1 = sx1[ 6 ] - ( S2*sx1[7] ); \ - d4x1 = sx1[ 5 ] - ( S3*sx1[6] ); \ - d5x1 = sx1[ 4 ] - ( S4*sx1[5] ); \ - d6x1 = sx1[ 3 ] - ( S5*sx1[4] ); \ - d7x1 = sx1[ 2 ] - ( S6*sx1[3] ); \ - d8x1 = sx1[ 1 ] - ( S7*sx1[2] ); \ - d9x1 = sx1[ 0 ] - ( S8*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 2 ]; \ - S3 = shape[ 3 ]; \ - S4 = shape[ 4 ]; \ - S5 = shape[ 5 ]; \ - S6 = shape[ 6 ]; \ - S7 = shape[ 7 ]; \ - S8 = shape[ 8 ]; \ - S9 = shape[ 9 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[1] ); \ - d3x1 = sx1[ 3 ] - ( S2*sx1[2] ); \ - d4x1 = sx1[ 4 ] - ( S3*sx1[3] ); \ - d5x1 = sx1[ 5 ] - ( S4*sx1[4] ); \ - d6x1 = sx1[ 6 ] - ( S5*sx1[5] ); \ - d7x1 = sx1[ 7 ] - ( S6*sx1[6] ); \ - d8x1 = sx1[ 8 ] - ( S7*sx1[7] ); \ - d9x1 = sx1[ 9 ] - ( S8*sx1[8] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i9 = 0; i9 < S9; i9++, px1 += d9x1 ) { \ - for ( i8 = 0; i8 < S8; i8++, px1 += d8x1 ) { \ - for ( i7 = 0; i7 < S7; i7++, px1 += d7x1 ) { \ - for ( i6 = 0; i6 < S6; i6++, px1 += d6x1 ) { \ - for ( i5 = 0; i5 < S5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < S4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < S3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < S2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of a ten-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_10D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_10D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_10D_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a ten-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_10D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_10D_LOOP_EPILOGUE - -/** -* Macro for a ten-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_10D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_10D_LOOP_EPILOGUE - -/** -* Macro for a ten-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_10D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_10D_LOOP_EPILOGUE - -/** -* Macro for a ten-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_10D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_10D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_10D_H diff --git a/include/stdlib/ndarray/base/every/macros/10d_blocked.h b/include/stdlib/ndarray/base/every/macros/10d_blocked.h deleted file mode 100644 index ee8a7dd..0000000 --- a/include/stdlib/ndarray/base/every/macros/10d_blocked.h +++ /dev/null @@ -1,382 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_10D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_10D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of a ten-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[10]; \ - int64_t sx1[10]; \ - int64_t idx[10]; \ - int64_t tmp[10]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t d6x1; \ - int64_t d7x1; \ - int64_t d8x1; \ - int64_t d9x1; \ - int64_t o1x1; \ - int64_t o2x1; \ - int64_t o3x1; \ - int64_t o4x1; \ - int64_t o5x1; \ - int64_t o6x1; \ - int64_t o7x1; \ - int64_t o8x1; \ - int64_t o9x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t s2; \ - int64_t s3; \ - int64_t s4; \ - int64_t s5; \ - int64_t s6; \ - int64_t s7; \ - int64_t s8; \ - int64_t s9; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t i6; \ - int64_t i7; \ - int64_t i8; \ - int64_t i9; \ - int64_t j0; \ - int64_t j1; \ - int64_t j2; \ - int64_t j3; \ - int64_t j4; \ - int64_t j5; \ - int64_t j6; \ - int64_t j7; \ - int64_t j8; \ - int64_t j9; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 10, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 10, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 10, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache byte offsets to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j9 = shape[9]; j9 > 0; ) { \ - if ( j9 < bsize ) { \ - s9 = j9; \ - j9 = 0; \ - } else { \ - s9 = bsize; \ - j9 -= bsize; \ - } \ - o9x1 = ox1 + ( j9*sx1[9] ); \ - for ( j8 = shape[8]; j8 > 0; ) { \ - if ( j8 < bsize ) { \ - s8 = j8; \ - j8 = 0; \ - } else { \ - s8 = bsize; \ - j8 -= bsize; \ - } \ - d9x1 = sx1[9] - ( s8*sx1[8] ); \ - o8x1 = o9x1 + ( j8*sx1[8] ); \ - for ( j7 = shape[7]; j7 > 0; ) { \ - if ( j7 < bsize ) { \ - s7 = j7; \ - j7 = 0; \ - } else { \ - s7 = bsize; \ - j7 -= bsize; \ - } \ - d8x1 = sx1[8] - ( s7*sx1[7] ); \ - o7x1 = o8x1 + ( j7*sx1[7] ); \ - for ( j6 = shape[6]; j6 > 0; ) { \ - if ( j6 < bsize ) { \ - s6 = j6; \ - j6 = 0; \ - } else { \ - s6 = bsize; \ - j6 -= bsize; \ - } \ - d7x1 = sx1[7] - ( s6*sx1[6] ); \ - o6x1 = o7x1 + ( j6*sx1[6] ); \ - for ( j5 = shape[5]; j5 > 0; ) { \ - if ( j5 < bsize ) { \ - s5 = j5; \ - j5 = 0; \ - } else { \ - s5 = bsize; \ - j5 -= bsize; \ - } \ - d6x1 = sx1[6] - ( s5*sx1[5] ); \ - o5x1 = o6x1 + ( j5*sx1[5] ); \ - for ( j4 = shape[4]; j4 > 0; ) { \ - if ( j4 < bsize ) { \ - s4 = j4; \ - j4 = 0; \ - } else { \ - s4 = bsize; \ - j4 -= bsize; \ - } \ - d5x1 = sx1[5] - ( s4*sx1[4] ); \ - o4x1 = o5x1 + ( j4*sx1[4] ); \ - for ( j3 = shape[3]; j3 > 0; ) { \ - if ( j3 < bsize ) { \ - s3 = j3; \ - j3 = 0; \ - } else { \ - s3 = bsize; \ - j3 -= bsize; \ - } \ - d4x1 = sx1[4] - ( s3*sx1[3] ); \ - o3x1 = o4x1 + ( j3*sx1[3] ); \ - for ( j2 = shape[2]; j2 > 0; ) { \ - if ( j2 < bsize ) { \ - s2 = j2; \ - j2 = 0; \ - } else { \ - s2 = bsize; \ - j2 -= bsize; \ - } \ - d3x1 = sx1[3] - ( s2*sx1[2] ); \ - o2x1 = o3x1 + ( j2*sx1[2] ); \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - d2x1 = sx1[2] - ( s1*sx1[1] ); \ - o1x1 = o2x1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute a pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i9 = 0; i9 < s9; i9++, px1 += d9x1 ) { \ - for ( i8 = 0; i8 < s8; i8++, px1 += d8x1 ) { \ - for ( i7 = 0; i7 < s7; i7++, px1 += d7x1 ) { \ - for ( i6 = 0; i6 < s6; i6++, px1 += d6x1 ) { \ - for ( i5 = 0; i5 < s5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < s4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < s3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < s2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of a ten-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked ten-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked ten-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked ten-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked ten-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_10D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/1d.h b/include/stdlib/ndarray/base/every/macros/1d.h deleted file mode 100644 index 96cf78c..0000000 --- a/include/stdlib/ndarray/base/every/macros/1d.h +++ /dev/null @@ -1,176 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_1D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_1D_H - -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Macro containing the preamble for a loop which operates on elements of a one-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_1D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_1D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_1D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t S0; \ - int64_t i0; \ - /* Extract loop variables: dimensions and loop offset (pointer) increments... */ \ - S0 = shape[ 0 ]; \ - d0x1 = sx1[ 0 ]; \ - /* Set a pointer to the first indexed element... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for loops which operate on elements of a one-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_1D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_1D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_1D_LOOP_EPILOGUE \ - *px2 = true; - -/** -* Macro for a one-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_1D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_1D_LOOP_EPILOGUE - -/** -* Macro for a one-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_1D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_1D_LOOP_EPILOGUE - -/** -* Macro for a one-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_1D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_1D_LOOP_EPILOGUE - -/** -* Macro for a one-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_1D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_1D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_1D_H diff --git a/include/stdlib/ndarray/base/every/macros/2d.h b/include/stdlib/ndarray/base/every/macros/2d.h deleted file mode 100644 index de0df19..0000000 --- a/include/stdlib/ndarray/base/every/macros/2d.h +++ /dev/null @@ -1,193 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_2D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_2D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of a two-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_2D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_2D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_2D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t i0; \ - int64_t i1; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 1 ]; \ - S1 = shape[ 0 ]; \ - d0x1 = sx1[ 1 ]; \ - d1x1 = sx1[ 0 ] - ( S0*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of a two-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_2D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_2D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_2D_LOOP_EPILOGUE \ - } \ - *px2 = true; - -/** -* Macro for a two-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_2D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_2D_LOOP_EPILOGUE - -/** -* Macro for a two-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_2D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_2D_LOOP_EPILOGUE - -/** -* Macro for a two-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_2D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_2D_LOOP_EPILOGUE - -/** -* Macro for a two-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_2D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_2D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_2D_H diff --git a/include/stdlib/ndarray/base/every/macros/2d_blocked.h b/include/stdlib/ndarray/base/every/macros/2d_blocked.h deleted file mode 100644 index f2b620e..0000000 --- a/include/stdlib/ndarray/base/every/macros/2d_blocked.h +++ /dev/null @@ -1,238 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_2D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_2D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of a two-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[2]; \ - int64_t sx1[2]; \ - int64_t idx[2]; \ - int64_t tmp[2]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t o1x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t i0; \ - int64_t i1; \ - int64_t j0; \ - int64_t j1; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 2, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 2, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 2, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the input ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache a byte offset to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - o1x1 = ox1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute a pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of a two-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked two-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked two-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked two-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked two-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_2D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/3d.h b/include/stdlib/ndarray/base/every/macros/3d.h deleted file mode 100644 index f042727..0000000 --- a/include/stdlib/ndarray/base/every/macros/3d.h +++ /dev/null @@ -1,202 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_3D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_3D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of a three-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_3D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_3D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_3D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t S2; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 2 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 0 ]; \ - d0x1 = sx1[ 2 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[2] ); \ - d2x1 = sx1[ 0 ] - ( S1*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 2 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[1] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i2 = 0; i2 < S2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of a three-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_3D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_3D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_3D_LOOP_EPILOGUE \ - } \ - } \ - *px2 = true; - -/** -* Macro for a three-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_3D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_3D_LOOP_EPILOGUE - -/** -* Macro for a three-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_3D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_3D_LOOP_EPILOGUE - -/** -* Macro for a three-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_3D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_3D_LOOP_EPILOGUE - -/** -* Macro for a three-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_3D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_3D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_3D_H diff --git a/include/stdlib/ndarray/base/every/macros/3d_blocked.h b/include/stdlib/ndarray/base/every/macros/3d_blocked.h deleted file mode 100644 index d70a6fe..0000000 --- a/include/stdlib/ndarray/base/every/macros/3d_blocked.h +++ /dev/null @@ -1,256 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_3D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_3D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of a three-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[3]; \ - int64_t sx1[3]; \ - int64_t idx[3]; \ - int64_t tmp[3]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t o1x1; \ - int64_t o2x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t s2; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t j0; \ - int64_t j1; \ - int64_t j2; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 3, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 3, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 3, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache a byte offset to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j2 = shape[2]; j2 > 0; ) { \ - if ( j2 < bsize ) { \ - s2 = j2; \ - j2 = 0; \ - } else { \ - s2 = bsize; \ - j2 -= bsize; \ - } \ - o2x1 = ox1 + ( j2*sx1[2] ); \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - d2x1 = sx1[2] - ( s1*sx1[1] ); \ - o1x1 = o2x1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute a pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i2 = 0; i2 < s2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of a three-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked three-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked three-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked three-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked three-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_3D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/4d.h b/include/stdlib/ndarray/base/every/macros/4d.h deleted file mode 100644 index ac61061..0000000 --- a/include/stdlib/ndarray/base/every/macros/4d.h +++ /dev/null @@ -1,211 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_4D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_4D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of a four-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_4D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_4D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_4D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t S2; \ - int64_t S3; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 3 ]; \ - S1 = shape[ 2 ]; \ - S2 = shape[ 1 ]; \ - S3 = shape[ 0 ]; \ - d0x1 = sx1[ 3 ]; \ - d1x1 = sx1[ 2 ] - ( S0*sx1[3] ); \ - d2x1 = sx1[ 1 ] - ( S1*sx1[2] ); \ - d3x1 = sx1[ 0 ] - ( S2*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 2 ]; \ - S3 = shape[ 3 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[1] ); \ - d3x1 = sx1[ 3 ] - ( S2*sx1[2] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i3 = 0; i3 < S3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < S2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of a four-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_4D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_4D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_4D_LOOP_EPILOGUE \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a four-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_4D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_4D_LOOP_EPILOGUE - -/** -* Macro for a four-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_4D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_4D_LOOP_EPILOGUE - -/** -* Macro for a four-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_4D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_4D_LOOP_EPILOGUE - -/** -* Macro for a four-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_4D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_4D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_4D_H diff --git a/include/stdlib/ndarray/base/every/macros/4d_blocked.h b/include/stdlib/ndarray/base/every/macros/4d_blocked.h deleted file mode 100644 index 2eb9335..0000000 --- a/include/stdlib/ndarray/base/every/macros/4d_blocked.h +++ /dev/null @@ -1,274 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_4D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_4D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of a four-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[4]; \ - int64_t sx1[4]; \ - int64_t idx[4]; \ - int64_t tmp[4]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t o1x1; \ - int64_t o2x1; \ - int64_t o3x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t s2; \ - int64_t s3; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t j0; \ - int64_t j1; \ - int64_t j2; \ - int64_t j3; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 4, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 4, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 4, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache a byte offset to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j3 = shape[3]; j3 > 0; ) { \ - if ( j3 < bsize ) { \ - s3 = j3; \ - j3 = 0; \ - } else { \ - s3 = bsize; \ - j3 -= bsize; \ - } \ - o3x1 = ox1 + ( j3*sx1[3] ); \ - for ( j2 = shape[2]; j2 > 0; ) { \ - if ( j2 < bsize ) { \ - s2 = j2; \ - j2 = 0; \ - } else { \ - s2 = bsize; \ - j2 -= bsize; \ - } \ - d3x1 = sx1[3] - ( s2*sx1[2] ); \ - o2x1 = o3x1 + ( j2*sx1[2] ); \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - d2x1 = sx1[2] - ( s1*sx1[1] ); \ - o1x1 = o2x1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute a pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i3 = 0; i3 < s3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < s2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of a four-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked four-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked four-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked four-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked four-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_4D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/5d.h b/include/stdlib/ndarray/base/every/macros/5d.h deleted file mode 100644 index 990efaf..0000000 --- a/include/stdlib/ndarray/base/every/macros/5d.h +++ /dev/null @@ -1,220 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_5D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_5D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of a five-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_5D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_5D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_5D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t S2; \ - int64_t S3; \ - int64_t S4; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 4 ]; \ - S1 = shape[ 3 ]; \ - S2 = shape[ 2 ]; \ - S3 = shape[ 1 ]; \ - S4 = shape[ 0 ]; \ - d0x1 = sx1[ 4 ]; \ - d1x1 = sx1[ 3 ] - ( S0*sx1[4] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[3] ); \ - d3x1 = sx1[ 1 ] - ( S2*sx1[2] ); \ - d4x1 = sx1[ 0 ] - ( S3*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 2 ]; \ - S3 = shape[ 3 ]; \ - S4 = shape[ 4 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[1] ); \ - d3x1 = sx1[ 3 ] - ( S2*sx1[2] ); \ - d4x1 = sx1[ 4 ] - ( S3*sx1[3] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i4 = 0; i4 < S4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < S3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < S2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of a five-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_5D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_5D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_5D_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a five-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_5D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_5D_LOOP_EPILOGUE - -/** -* Macro for a five-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_5D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_5D_LOOP_EPILOGUE - -/** -* Macro for a five-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_5D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_5D_LOOP_EPILOGUE - -/** -* Macro for a five-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_5D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_5D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_5D_H diff --git a/include/stdlib/ndarray/base/every/macros/5d_blocked.h b/include/stdlib/ndarray/base/every/macros/5d_blocked.h deleted file mode 100644 index 9b2d26e..0000000 --- a/include/stdlib/ndarray/base/every/macros/5d_blocked.h +++ /dev/null @@ -1,292 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_5D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_5D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of a five-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[5]; \ - int64_t sx1[5]; \ - int64_t idx[5]; \ - int64_t tmp[5]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t o1x1; \ - int64_t o2x1; \ - int64_t o3x1; \ - int64_t o4x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t s2; \ - int64_t s3; \ - int64_t s4; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t j0; \ - int64_t j1; \ - int64_t j2; \ - int64_t j3; \ - int64_t j4; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 5, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 5, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 5, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache the byte offset to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j4 = shape[4]; j4 > 0; ) { \ - if ( j4 < bsize ) { \ - s4 = j4; \ - j4 = 0; \ - } else { \ - s4 = bsize; \ - j4 -= bsize; \ - } \ - o4x1 = ox1 + ( j4*sx1[4] ); \ - for ( j3 = shape[3]; j3 > 0; ) { \ - if ( j3 < bsize ) { \ - s3 = j3; \ - j3 = 0; \ - } else { \ - s3 = bsize; \ - j3 -= bsize; \ - } \ - d4x1 = sx1[4] - ( s3*sx1[3] ); \ - o3x1 = o4x1 + ( j3*sx1[3] ); \ - for ( j2 = shape[2]; j2 > 0; ) { \ - if ( j2 < bsize ) { \ - s2 = j2; \ - j2 = 0; \ - } else { \ - s2 = bsize; \ - j2 -= bsize; \ - } \ - d3x1 = sx1[3] - ( s2*sx1[2] ); \ - o2x1 = o3x1 + ( j2*sx1[2] ); \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - d2x1 = sx1[2] - ( s1*sx1[1] ); \ - o1x1 = o2x1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute a pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i4 = 0; i4 < s4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < s3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < s2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of a five-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked five-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked five-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked five-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked five-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_5D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/6d.h b/include/stdlib/ndarray/base/every/macros/6d.h deleted file mode 100644 index 98df6a2..0000000 --- a/include/stdlib/ndarray/base/every/macros/6d.h +++ /dev/null @@ -1,229 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_6D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_6D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of a six-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_6D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_6D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_6D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t S2; \ - int64_t S3; \ - int64_t S4; \ - int64_t S5; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 5 ]; \ - S1 = shape[ 4 ]; \ - S2 = shape[ 3 ]; \ - S3 = shape[ 2 ]; \ - S4 = shape[ 1 ]; \ - S5 = shape[ 0 ]; \ - d0x1 = sx1[ 5 ]; \ - d1x1 = sx1[ 4 ] - ( S0*sx1[5] ); \ - d2x1 = sx1[ 3 ] - ( S1*sx1[4] ); \ - d3x1 = sx1[ 2 ] - ( S2*sx1[3] ); \ - d4x1 = sx1[ 1 ] - ( S3*sx1[2] ); \ - d5x1 = sx1[ 0 ] - ( S4*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 2 ]; \ - S3 = shape[ 3 ]; \ - S4 = shape[ 4 ]; \ - S5 = shape[ 5 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[1] ); \ - d3x1 = sx1[ 3 ] - ( S2*sx1[2] ); \ - d4x1 = sx1[ 4 ] - ( S3*sx1[3] ); \ - d5x1 = sx1[ 5 ] - ( S4*sx1[4] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i5 = 0; i5 < S5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < S4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < S3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < S2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of a six-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_6D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_6D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_6D_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a six-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_6D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_6D_LOOP_EPILOGUE - -/** -* Macro for a six-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_6D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_6D_LOOP_EPILOGUE - -/** -* Macro for a six-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_6D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_6D_LOOP_EPILOGUE - -/** -* Macro for a six-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_6D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_6D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_6D_H diff --git a/include/stdlib/ndarray/base/every/macros/6d_blocked.h b/include/stdlib/ndarray/base/every/macros/6d_blocked.h deleted file mode 100644 index 8329362..0000000 --- a/include/stdlib/ndarray/base/every/macros/6d_blocked.h +++ /dev/null @@ -1,310 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_6D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_6D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of a six-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[6]; \ - int64_t sx1[6]; \ - int64_t idx[6]; \ - int64_t tmp[6]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t o1x1; \ - int64_t o2x1; \ - int64_t o3x1; \ - int64_t o4x1; \ - int64_t o5x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t s2; \ - int64_t s3; \ - int64_t s4; \ - int64_t s5; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t j0; \ - int64_t j1; \ - int64_t j2; \ - int64_t j3; \ - int64_t j4; \ - int64_t j5; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 6, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 6, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 6, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache the byte offset to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j5 = shape[5]; j5 > 0; ) { \ - if ( j5 < bsize ) { \ - s5 = j5; \ - j5 = 0; \ - } else { \ - s5 = bsize; \ - j5 -= bsize; \ - } \ - o5x1 = ox1 + ( j5*sx1[5] ); \ - for ( j4 = shape[4]; j4 > 0; ) { \ - if ( j4 < bsize ) { \ - s4 = j4; \ - j4 = 0; \ - } else { \ - s4 = bsize; \ - j4 -= bsize; \ - } \ - d5x1 = sx1[5] - ( s4*sx1[4] ); \ - o4x1 = o5x1 + ( j4*sx1[4] ); \ - for ( j3 = shape[3]; j3 > 0; ) { \ - if ( j3 < bsize ) { \ - s3 = j3; \ - j3 = 0; \ - } else { \ - s3 = bsize; \ - j3 -= bsize; \ - } \ - d4x1 = sx1[4] - ( s3*sx1[3] ); \ - o3x1 = o4x1 + ( j3*sx1[3] ); \ - for ( j2 = shape[2]; j2 > 0; ) { \ - if ( j2 < bsize ) { \ - s2 = j2; \ - j2 = 0; \ - } else { \ - s2 = bsize; \ - j2 -= bsize; \ - } \ - d3x1 = sx1[3] - ( s2*sx1[2] ); \ - o2x1 = o3x1 + ( j2*sx1[2] ); \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - d2x1 = sx1[2] - ( s1*sx1[1] ); \ - o1x1 = o2x1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute the pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i5 = 0; i5 < s5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < s4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < s3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < s2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of a six-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked six-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked six-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked six-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked six-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_6D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/7d.h b/include/stdlib/ndarray/base/every/macros/7d.h deleted file mode 100644 index 0252b1a..0000000 --- a/include/stdlib/ndarray/base/every/macros/7d.h +++ /dev/null @@ -1,238 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_7D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_7D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of a seven-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_7D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_7D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_7D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t d6x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t S2; \ - int64_t S3; \ - int64_t S4; \ - int64_t S5; \ - int64_t S6; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t i6; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 6 ]; \ - S1 = shape[ 5 ]; \ - S2 = shape[ 4 ]; \ - S3 = shape[ 3 ]; \ - S4 = shape[ 2 ]; \ - S5 = shape[ 1 ]; \ - S6 = shape[ 0 ]; \ - d0x1 = sx1[ 6 ]; \ - d1x1 = sx1[ 5 ] - ( S0*sx1[6] ); \ - d2x1 = sx1[ 4 ] - ( S1*sx1[5] ); \ - d3x1 = sx1[ 3 ] - ( S2*sx1[4] ); \ - d4x1 = sx1[ 2 ] - ( S3*sx1[3] ); \ - d5x1 = sx1[ 1 ] - ( S4*sx1[2] ); \ - d6x1 = sx1[ 0 ] - ( S5*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 2 ]; \ - S3 = shape[ 3 ]; \ - S4 = shape[ 4 ]; \ - S5 = shape[ 5 ]; \ - S6 = shape[ 6 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[1] ); \ - d3x1 = sx1[ 3 ] - ( S2*sx1[2] ); \ - d4x1 = sx1[ 4 ] - ( S3*sx1[3] ); \ - d5x1 = sx1[ 5 ] - ( S4*sx1[4] ); \ - d6x1 = sx1[ 6 ] - ( S5*sx1[5] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i6 = 0; i6 < S6; i6++, px1 += d6x1 ) { \ - for ( i5 = 0; i5 < S5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < S4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < S3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < S2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of a seven-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_7D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_7D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_7D_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a seven-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_7D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_7D_LOOP_EPILOGUE - -/** -* Macro for a seven-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_7D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_7D_LOOP_EPILOGUE - -/** -* Macro for a seven-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_7D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_7D_LOOP_EPILOGUE - -/** -* Macro for a seven-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_7D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_7D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_7D_H diff --git a/include/stdlib/ndarray/base/every/macros/7d_blocked.h b/include/stdlib/ndarray/base/every/macros/7d_blocked.h deleted file mode 100644 index fac9f59..0000000 --- a/include/stdlib/ndarray/base/every/macros/7d_blocked.h +++ /dev/null @@ -1,328 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_7D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_7D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of a seven-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[7]; \ - int64_t sx1[7]; \ - int64_t idx[7]; \ - int64_t tmp[7]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t d6x1; \ - int64_t o1x1; \ - int64_t o2x1; \ - int64_t o3x1; \ - int64_t o4x1; \ - int64_t o5x1; \ - int64_t o6x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t s2; \ - int64_t s3; \ - int64_t s4; \ - int64_t s5; \ - int64_t s6; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t i6; \ - int64_t j0; \ - int64_t j1; \ - int64_t j2; \ - int64_t j3; \ - int64_t j4; \ - int64_t j5; \ - int64_t j6; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 7, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 7, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 7, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache a byte offset to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j6 = shape[6]; j6 > 0; ) { \ - if ( j6 < bsize ) { \ - s6 = j6; \ - j6 = 0; \ - } else { \ - s6 = bsize; \ - j6 -= bsize; \ - } \ - o6x1 = ox1 + ( j6*sx1[6] ); \ - for ( j5 = shape[5]; j5 > 0; ) { \ - if ( j5 < bsize ) { \ - s5 = j5; \ - j5 = 0; \ - } else { \ - s5 = bsize; \ - j5 -= bsize; \ - } \ - d6x1 = sx1[6] - ( s5*sx1[5] ); \ - o5x1 = o6x1 + ( j5*sx1[5] ); \ - for ( j4 = shape[4]; j4 > 0; ) { \ - if ( j4 < bsize ) { \ - s4 = j4; \ - j4 = 0; \ - } else { \ - s4 = bsize; \ - j4 -= bsize; \ - } \ - d5x1 = sx1[5] - ( s4*sx1[4] ); \ - o4x1 = o5x1 + ( j4*sx1[4] ); \ - for ( j3 = shape[3]; j3 > 0; ) { \ - if ( j3 < bsize ) { \ - s3 = j3; \ - j3 = 0; \ - } else { \ - s3 = bsize; \ - j3 -= bsize; \ - } \ - d4x1 = sx1[4] - ( s3*sx1[3] ); \ - o3x1 = o4x1 + ( j3*sx1[3] ); \ - for ( j2 = shape[2]; j2 > 0; ) { \ - if ( j2 < bsize ) { \ - s2 = j2; \ - j2 = 0; \ - } else { \ - s2 = bsize; \ - j2 -= bsize; \ - } \ - d3x1 = sx1[3] - ( s2*sx1[2] ); \ - o2x1 = o3x1 + ( j2*sx1[2] ); \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - d2x1 = sx1[2] - ( s1*sx1[1] ); \ - o1x1 = o2x1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute a pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i6 = 0; i6 < s6; i6++, px1 += d6x1 ) { \ - for ( i5 = 0; i5 < s5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < s4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < s3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < s2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of a seven-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked seven-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked seven-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked seven-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked seven-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_7D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/8d.h b/include/stdlib/ndarray/base/every/macros/8d.h deleted file mode 100644 index d16619f..0000000 --- a/include/stdlib/ndarray/base/every/macros/8d.h +++ /dev/null @@ -1,247 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_8D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_8D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of an eight-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_8D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_8D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_8D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t d6x1; \ - int64_t d7x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t S2; \ - int64_t S3; \ - int64_t S4; \ - int64_t S5; \ - int64_t S6; \ - int64_t S7; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t i6; \ - int64_t i7; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 7 ]; \ - S1 = shape[ 6 ]; \ - S2 = shape[ 5 ]; \ - S3 = shape[ 4 ]; \ - S4 = shape[ 3 ]; \ - S5 = shape[ 2 ]; \ - S6 = shape[ 1 ]; \ - S7 = shape[ 0 ]; \ - d0x1 = sx1[ 7 ]; \ - d1x1 = sx1[ 6 ] - ( S0*sx1[7] ); \ - d2x1 = sx1[ 5 ] - ( S1*sx1[6] ); \ - d3x1 = sx1[ 4 ] - ( S2*sx1[5] ); \ - d4x1 = sx1[ 3 ] - ( S3*sx1[4] ); \ - d5x1 = sx1[ 2 ] - ( S4*sx1[3] ); \ - d6x1 = sx1[ 1 ] - ( S5*sx1[2] ); \ - d7x1 = sx1[ 0 ] - ( S6*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 2 ]; \ - S3 = shape[ 3 ]; \ - S4 = shape[ 4 ]; \ - S5 = shape[ 5 ]; \ - S6 = shape[ 6 ]; \ - S7 = shape[ 7 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[1] ); \ - d3x1 = sx1[ 3 ] - ( S2*sx1[2] ); \ - d4x1 = sx1[ 4 ] - ( S3*sx1[3] ); \ - d5x1 = sx1[ 5 ] - ( S4*sx1[4] ); \ - d6x1 = sx1[ 6 ] - ( S5*sx1[5] ); \ - d7x1 = sx1[ 7 ] - ( S6*sx1[6] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i7 = 0; i7 < S7; i7++, px1 += d7x1 ) { \ - for ( i6 = 0; i6 < S6; i6++, px1 += d6x1 ) { \ - for ( i5 = 0; i5 < S5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < S4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < S3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < S2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of an eight-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_8D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_8D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_8D_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for an eight-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_8D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_8D_LOOP_EPILOGUE - -/** -* Macro for an eight-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_8D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_8D_LOOP_EPILOGUE - -/** -* Macro for an eight-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_8D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_8D_LOOP_EPILOGUE - -/** -* Macro for an eight-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_8D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_8D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_8D_H diff --git a/include/stdlib/ndarray/base/every/macros/8d_blocked.h b/include/stdlib/ndarray/base/every/macros/8d_blocked.h deleted file mode 100644 index 3714963..0000000 --- a/include/stdlib/ndarray/base/every/macros/8d_blocked.h +++ /dev/null @@ -1,346 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_8D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_8D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of an eight-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[8]; \ - int64_t sx1[8]; \ - int64_t idx[8]; \ - int64_t tmp[8]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t d6x1; \ - int64_t d7x1; \ - int64_t o1x1; \ - int64_t o2x1; \ - int64_t o3x1; \ - int64_t o4x1; \ - int64_t o5x1; \ - int64_t o6x1; \ - int64_t o7x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t s2; \ - int64_t s3; \ - int64_t s4; \ - int64_t s5; \ - int64_t s6; \ - int64_t s7; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t i6; \ - int64_t i7; \ - int64_t j0; \ - int64_t j1; \ - int64_t j2; \ - int64_t j3; \ - int64_t j4; \ - int64_t j5; \ - int64_t j6; \ - int64_t j7; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 8, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 8, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 8, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache a byte offset to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j7 = shape[7]; j7 > 0; ) { \ - if ( j7 < bsize ) { \ - s7 = j7; \ - j7 = 0; \ - } else { \ - s7 = bsize; \ - j7 -= bsize; \ - } \ - o7x1 = ox1 + ( j7*sx1[7] ); \ - for ( j6 = shape[6]; j6 > 0; ) { \ - if ( j6 < bsize ) { \ - s6 = j6; \ - j6 = 0; \ - } else { \ - s6 = bsize; \ - j6 -= bsize; \ - } \ - d7x1 = sx1[7] - ( s6*sx1[6] ); \ - o6x1 = o7x1 + ( j6*sx1[6] ); \ - for ( j5 = shape[5]; j5 > 0; ) { \ - if ( j5 < bsize ) { \ - s5 = j5; \ - j5 = 0; \ - } else { \ - s5 = bsize; \ - j5 -= bsize; \ - } \ - d6x1 = sx1[6] - ( s5*sx1[5] ); \ - o5x1 = o6x1 + ( j5*sx1[5] ); \ - for ( j4 = shape[4]; j4 > 0; ) { \ - if ( j4 < bsize ) { \ - s4 = j4; \ - j4 = 0; \ - } else { \ - s4 = bsize; \ - j4 -= bsize; \ - } \ - d5x1 = sx1[5] - ( s4*sx1[4] ); \ - o4x1 = o5x1 + ( j4*sx1[4] ); \ - for ( j3 = shape[3]; j3 > 0; ) { \ - if ( j3 < bsize ) { \ - s3 = j3; \ - j3 = 0; \ - } else { \ - s3 = bsize; \ - j3 -= bsize; \ - } \ - d4x1 = sx1[4] - ( s3*sx1[3] ); \ - o3x1 = o4x1 + ( j3*sx1[3] ); \ - for ( j2 = shape[2]; j2 > 0; ) { \ - if ( j2 < bsize ) { \ - s2 = j2; \ - j2 = 0; \ - } else { \ - s2 = bsize; \ - j2 -= bsize; \ - } \ - d3x1 = sx1[3] - ( s2*sx1[2] ); \ - o2x1 = o3x1 + ( j2*sx1[2] ); \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - d2x1 = sx1[2] - ( s1*sx1[1] ); \ - o1x1 = o2x1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute a pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i7 = 0; i7 < s7; i7++, px1 += d7x1 ) { \ - for ( i6 = 0; i6 < s6; i6++, px1 += d6x1 ) { \ - for ( i5 = 0; i5 < s5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < s4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < s3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < s2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of an eight-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked eight-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked eight-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked eight-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked eight-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_8D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/9d.h b/include/stdlib/ndarray/base/every/macros/9d.h deleted file mode 100644 index c3dd78b..0000000 --- a/include/stdlib/ndarray/base/every/macros/9d.h +++ /dev/null @@ -1,256 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_9D_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_9D_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of a nine-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_9D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_9D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_9D_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - const int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - uint8_t *px1 = stdlib_ndarray_data( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t d6x1; \ - int64_t d7x1; \ - int64_t d8x1; \ - int64_t S0; \ - int64_t S1; \ - int64_t S2; \ - int64_t S3; \ - int64_t S4; \ - int64_t S5; \ - int64_t S6; \ - int64_t S7; \ - int64_t S8; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t i6; \ - int64_t i7; \ - int64_t i8; \ - /* Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... */ \ - if ( stdlib_ndarray_order( x1 ) == STDLIB_NDARRAY_ROW_MAJOR ) { \ - /* For row-major ndarrays, the last dimensions have the fastest changing indices... */ \ - S0 = shape[ 8 ]; \ - S1 = shape[ 7 ]; \ - S2 = shape[ 6 ]; \ - S3 = shape[ 5 ]; \ - S4 = shape[ 4 ]; \ - S5 = shape[ 3 ]; \ - S6 = shape[ 2 ]; \ - S7 = shape[ 1 ]; \ - S8 = shape[ 0 ]; \ - d0x1 = sx1[ 8 ]; \ - d1x1 = sx1[ 7 ] - ( S0*sx1[8] ); \ - d2x1 = sx1[ 6 ] - ( S1*sx1[7] ); \ - d3x1 = sx1[ 5 ] - ( S2*sx1[6] ); \ - d4x1 = sx1[ 4 ] - ( S3*sx1[5] ); \ - d5x1 = sx1[ 3 ] - ( S4*sx1[4] ); \ - d6x1 = sx1[ 2 ] - ( S5*sx1[3] ); \ - d7x1 = sx1[ 1 ] - ( S6*sx1[2] ); \ - d8x1 = sx1[ 0 ] - ( S7*sx1[1] ); \ - } else { \ - /* For column-major ndarrays, the first dimensions have the fastest changing indices... */ \ - S0 = shape[ 0 ]; \ - S1 = shape[ 1 ]; \ - S2 = shape[ 2 ]; \ - S3 = shape[ 3 ]; \ - S4 = shape[ 4 ]; \ - S5 = shape[ 5 ]; \ - S6 = shape[ 6 ]; \ - S7 = shape[ 7 ]; \ - S8 = shape[ 8 ]; \ - d0x1 = sx1[ 0 ]; \ - d1x1 = sx1[ 1 ] - ( S0*sx1[0] ); \ - d2x1 = sx1[ 2 ] - ( S1*sx1[1] ); \ - d3x1 = sx1[ 3 ] - ( S2*sx1[2] ); \ - d4x1 = sx1[ 4 ] - ( S3*sx1[3] ); \ - d5x1 = sx1[ 5 ] - ( S4*sx1[4] ); \ - d6x1 = sx1[ 6 ] - ( S5*sx1[5] ); \ - d7x1 = sx1[ 7 ] - ( S6*sx1[6] ); \ - d8x1 = sx1[ 8 ] - ( S7*sx1[7] ); \ - } \ - /* Set a pointer to the first indexed elements... */ \ - px1 += stdlib_ndarray_offset( x1 ); \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i8 = 0; i8 < S8; i8++, px1 += d8x1 ) { \ - for ( i7 = 0; i7 < S7; i7++, px1 += d7x1 ) { \ - for ( i6 = 0; i6 < S6; i6++, px1 += d6x1 ) { \ - for ( i5 = 0; i5 < S5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < S4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < S3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < S2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < S1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < S0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for nested loops which operate on elements of a nine-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_9D_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_9D_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_9D_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a nine-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_9D_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_9D_LOOP_EPILOGUE - -/** -* Macro for a nine-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_9D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_9D_LOOP_EPILOGUE - -/** -* Macro for a nine-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_9D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_9D_LOOP_EPILOGUE - -/** -* Macro for a nine-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_9D_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_9D_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_9D_H diff --git a/include/stdlib/ndarray/base/every/macros/9d_blocked.h b/include/stdlib/ndarray/base/every/macros/9d_blocked.h deleted file mode 100644 index 1014c2d..0000000 --- a/include/stdlib/ndarray/base/every/macros/9d_blocked.h +++ /dev/null @@ -1,364 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_9D_BLOCKED_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_9D_BLOCKED_H - -#include "stdlib/ndarray/base/every/macros/constants.h" -#include "stdlib/ndarray/base/every/internal/permute.h" -#include "stdlib/ndarray/base/every/internal/range.h" -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include -#include - -/** -* Macro containing the preamble for blocked nested loops which operate on elements of a nine-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `pbx#`, `px#`, `ox#`, `nbx#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, `j@`, `o@x#`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - int64_t shape[9]; \ - int64_t sx1[9]; \ - int64_t idx[9]; \ - int64_t tmp[9]; \ - int64_t bsize; \ - uint8_t *pbx1; \ - uint8_t *px1; \ - int64_t d0x1; \ - int64_t d1x1; \ - int64_t d2x1; \ - int64_t d3x1; \ - int64_t d4x1; \ - int64_t d5x1; \ - int64_t d6x1; \ - int64_t d7x1; \ - int64_t d8x1; \ - int64_t o1x1; \ - int64_t o2x1; \ - int64_t o3x1; \ - int64_t o4x1; \ - int64_t o5x1; \ - int64_t o6x1; \ - int64_t o7x1; \ - int64_t o8x1; \ - int64_t nbx1; \ - int64_t ox1; \ - int64_t s0; \ - int64_t s1; \ - int64_t s2; \ - int64_t s3; \ - int64_t s4; \ - int64_t s5; \ - int64_t s6; \ - int64_t s7; \ - int64_t s8; \ - int64_t i0; \ - int64_t i1; \ - int64_t i2; \ - int64_t i3; \ - int64_t i4; \ - int64_t i5; \ - int64_t i6; \ - int64_t i7; \ - int64_t i8; \ - int64_t j0; \ - int64_t j1; \ - int64_t j2; \ - int64_t j3; \ - int64_t j4; \ - int64_t j5; \ - int64_t j6; \ - int64_t j7; \ - int64_t j8; \ - /* Copy strides to prevent mutation to the original ndarray: */ \ - memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \ - /* Create a loop interchange index array for loop order permutation: */ \ - stdlib_ndarray_base_every_internal_range( 9, idx ); \ - /* Sort the input array strides in increasing order (of magnitude): */ \ - stdlib_ndarray_base_every_internal_sort2ins( 9, sx1, idx ); \ - /* Permute the shape (avoiding mutation) according to loop order: */ \ - stdlib_ndarray_base_every_internal_permute( 9, stdlib_ndarray_shape( x1 ), idx, tmp ); \ - memcpy( shape, tmp, sizeof shape ); \ - /* Determine the block size... */ \ - nbx1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); \ - if ( nbx1 == 0 ) { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS; \ - } else { \ - bsize = STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES / nbx1; \ - } \ - /* Cache a pointer to the ndarray buffer... */ \ - pbx1 = stdlib_ndarray_data( x1 ); \ - /* Cache a byte offset to the first indexed element... */ \ - ox1 = stdlib_ndarray_offset( x1 ); \ - /* Set a pointer to the first indexed element of the output ndarray... */ \ - px2 += stdlib_ndarray_offset( x2 ); \ - /* Cache the offset increment for the innermost loop... */ \ - d0x1 = sx1[0]; \ - /* Iterate over blocks... */ \ - for ( j8 = shape[8]; j8 > 0; ) { \ - if ( j8 < bsize ) { \ - s8 = j8; \ - j8 = 0; \ - } else { \ - s8 = bsize; \ - j8 -= bsize; \ - } \ - o8x1 = ox1 + ( j8*sx1[8] ); \ - for ( j7 = shape[7]; j7 > 0; ) { \ - if ( j7 < bsize ) { \ - s7 = j7; \ - j7 = 0; \ - } else { \ - s7 = bsize; \ - j7 -= bsize; \ - } \ - d8x1 = sx1[8] - ( s7*sx1[7] ); \ - o7x1 = o8x1 + ( j7*sx1[7] ); \ - for ( j6 = shape[6]; j6 > 0; ) { \ - if ( j6 < bsize ) { \ - s6 = j6; \ - j6 = 0; \ - } else { \ - s6 = bsize; \ - j6 -= bsize; \ - } \ - d7x1 = sx1[7] - ( s6*sx1[6] ); \ - o6x1 = o7x1 + ( j6*sx1[6] ); \ - for ( j5 = shape[5]; j5 > 0; ) { \ - if ( j5 < bsize ) { \ - s5 = j5; \ - j5 = 0; \ - } else { \ - s5 = bsize; \ - j5 -= bsize; \ - } \ - d6x1 = sx1[6] - ( s5*sx1[5] ); \ - o5x1 = o6x1 + ( j5*sx1[5] ); \ - for ( j4 = shape[4]; j4 > 0; ) { \ - if ( j4 < bsize ) { \ - s4 = j4; \ - j4 = 0; \ - } else { \ - s4 = bsize; \ - j4 -= bsize; \ - } \ - d5x1 = sx1[5] - ( s4*sx1[4] ); \ - o4x1 = o5x1 + ( j4*sx1[4] ); \ - for ( j3 = shape[3]; j3 > 0; ) { \ - if ( j3 < bsize ) { \ - s3 = j3; \ - j3 = 0; \ - } else { \ - s3 = bsize; \ - j3 -= bsize; \ - } \ - d4x1 = sx1[4] - ( s3*sx1[3] ); \ - o3x1 = o4x1 + ( j3*sx1[3] ); \ - for ( j2 = shape[2]; j2 > 0; ) { \ - if ( j2 < bsize ) { \ - s2 = j2; \ - j2 = 0; \ - } else { \ - s2 = bsize; \ - j2 -= bsize; \ - } \ - d3x1 = sx1[3] - ( s2*sx1[2] ); \ - o2x1 = o3x1 + ( j2*sx1[2] ); \ - for ( j1 = shape[1]; j1 > 0; ) { \ - if ( j1 < bsize ) { \ - s1 = j1; \ - j1 = 0; \ - } else { \ - s1 = bsize; \ - j1 -= bsize; \ - } \ - d2x1 = sx1[2] - ( s1*sx1[1] ); \ - o1x1 = o2x1 + ( j1*sx1[1] ); \ - for ( j0 = shape[0]; j0 > 0; ) { \ - if ( j0 < bsize ) { \ - s0 = j0; \ - j0 = 0; \ - } else { \ - s0 = bsize; \ - j0 -= bsize; \ - } \ - /* Compute a pointer to the first ndarray element in the current block... */ \ - px1 = pbx1 + o1x1 + ( j0*sx1[0] ); \ - /* Compute the loop offset increment... */ \ - d1x1 = sx1[1] - ( s0*sx1[0] ); \ - /* Iterate over the ndarray dimensions... */ \ - for ( i8 = 0; i8 < s8; i8++, px1 += d8x1 ) { \ - for ( i7 = 0; i7 < s7; i7++, px1 += d7x1 ) { \ - for ( i6 = 0; i6 < s6; i6++, px1 += d6x1 ) { \ - for ( i5 = 0; i5 < s5; i5++, px1 += d5x1 ) { \ - for ( i4 = 0; i4 < s4; i4++, px1 += d4x1 ) { \ - for ( i3 = 0; i3 < s3; i3++, px1 += d3x1 ) { \ - for ( i2 = 0; i2 < s2; i2++, px1 += d2x1 ) { \ - for ( i1 = 0; i1 < s1; i1++, px1 += d1x1 ) { \ - for ( i0 = 0; i0 < s0; i0++, px1 += d0x1 ) - -/** -* Macro containing the epilogue for blocked nested loops which operate on elements of a nine-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_EPILOGUE \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - } \ - *px2 = true; - -/** -* Macro for a blocked nine-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked nine-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked nine-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_EPILOGUE - -/** -* Macro for a blocked nine-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_9D_BLOCKED_H diff --git a/include/stdlib/ndarray/base/every/macros/constants.h b/include/stdlib/ndarray/base/every/macros/constants.h deleted file mode 100644 index 0952a3d..0000000 --- a/include/stdlib/ndarray/base/every/macros/constants.h +++ /dev/null @@ -1,28 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_CONSTANTS_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_CONSTANTS_H - -// Define a default block size in units of bytes (Note: 64b is a common cache line size. How applicable the common cache line size is here is debatable, given that, depending on the associated stride(s), the innermost loop may not iterate over adjacent elements. The primary goal is to have a block size in which all data within a block can always fit in (L1) cache, regardless of cache size (i.e., cache-oblivious). For reference, a common L1 cache size is 32kB per core. For best performance, block sizes should be tuned based on system hardware; however, such tuning is not readily available to us here. Without obvious better alternatives, 64b has some theoretical (and practical) underpinning, and it should be good enough for most inputs, especially for ndarrays with near contiguity.): -#define STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_BYTES 64 - -// Define a default block size in units of elements (Note: 64 bytes / 8 bytes per element; i.e., default element size is same as a double): -#define STDLIB_NDARRAY_EVERY_BLOCK_SIZE_IN_ELEMENTS 8 - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_CONSTANTS_H diff --git a/include/stdlib/ndarray/base/every/macros/nd.h b/include/stdlib/ndarray/base/every/macros/nd.h deleted file mode 100644 index 2e8dacc..0000000 --- a/include/stdlib/ndarray/base/every/macros/nd.h +++ /dev/null @@ -1,182 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_MACROS_ND_H -#define STDLIB_NDARRAY_BASE_EVERY_MACROS_ND_H - -#include "stdlib/ndarray/ctor.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/base/vind2bind.h" -#include -#include - -/** -* Macro containing the preamble for nested loops which operate on elements of an n-dimensional ndarray. -* -* ## Notes -* -* - Variable naming conventions: -* -* - `sx#`, `px#`, and `d@x#` where `#` corresponds to the ndarray argument number, starting at `1`. -* - `S@`, `i@`, and `d@x#` where `@` corresponds to the loop number, with `0` being the innermost loop. -* -* @example -* STDLIB_NDARRAY_EVERY_ND_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_ND_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_ND_LOOP_PREAMBLE \ - const struct ndarray *x1 = arrays[ 0 ]; \ - const struct ndarray *x2 = arrays[ 1 ]; \ - enum STDLIB_NDARRAY_INDEX_MODE mx1 = stdlib_ndarray_index_mode( x1 ); \ - enum STDLIB_NDARRAY_ORDER ordx1 = stdlib_ndarray_order( x1 ); \ - const int64_t *shape = stdlib_ndarray_shape( x1 ); \ - uint8_t *pbx1 = stdlib_ndarray_data( x1 ); \ - int64_t ndims = stdlib_ndarray_ndims( x1 ); \ - int64_t *sx1 = stdlib_ndarray_strides( x1 ); \ - int64_t ox1 = stdlib_ndarray_offset( x1 ); \ - int64_t len = stdlib_ndarray_length( x1 ); \ - uint8_t *px2 = stdlib_ndarray_data( x2 ); \ - uint8_t *px1; \ - int64_t i; \ - /* Iterate over each ndarray element based on the linear **view** index, regardless as to how the data is stored in memory... */ \ - for ( i = 0; i < len; i++ ) { \ - px1 = pbx1 + stdlib_ndarray_vind2bind( ndims, shape, sx1, ox1, ordx1, i, mx1 ); \ - do - -/** -* Macro containing the epilogue for nested loops which operate on elements of an n-dimensional ndarray. -* -* @example -* STDLIB_NDARRAY_EVERY_ND_LOOP_PREAMBLE { -* // Innermost loop body... -* } -* STDLIB_NDARRAY_EVERY_ND_LOOP_EPILOGUE -*/ -#define STDLIB_NDARRAY_EVERY_ND_LOOP_EPILOGUE \ - while( 0 ); \ - } \ - *px2 = true; - -/** -* Macro for an n-dimensional ndarray loop which inlines an expression. -* -* ## Notes -* -* - Retrieves each input ndarray element according to type `tin` via the pointer `px1` as `in1`. -* - Expects a provided expression to operate on `tin in1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param expr expression to inline -* -* @example -* STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( double, in1 ) -*/ -#define STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( tin, expr ) \ - STDLIB_NDARRAY_EVERY_ND_LOOP_PREAMBLE { \ - const tin in1 = *(tin *)px1; \ - if ( !( expr ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_ND_LOOP_EPILOGUE - -/** -* Macro for an n-dimensional ndarray loop which invokes a callback. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* -* @example -* // e.g., d_x -* STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( double ) -*/ -#define STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( tin ) \ - STDLIB_NDARRAY_EVERY_ND_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_ND_LOOP_EPILOGUE - -/** -* Macro for an n-dimensional ndarray loop which invokes a callback requiring arguments be explicitly cast to a different type. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via the pointer `px1`. -* - Explicitly casts each function argument to `fin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param fin callback argument type -* -* @example -* // e.g., f_x_as_d_x -* STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( float, double ) -*/ -#define STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( tin, fin ) \ - STDLIB_NDARRAY_EVERY_ND_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( (fin)x ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_ND_LOOP_EPILOGUE - -/** -* Macro for an n-dimensional ndarray loop which invokes a callback requiring arguments be cast to a different type via casting functions. -* -* ## Notes -* -* - Retrieves each ndarray element according to type `tin` via a pointer `px1`. -* - Explicitly casts each function argument via `cin`. -* - Stores the final result in an output ndarray via the pointer `px2`. -* -* @param tin input type -* @param cin input casting function -* -* @example -* #include "stdlib/complex/float64/ctor.h" -* -* // e.g., f_x_as_z_x -* STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) -*/ -#define STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( tin, cin ) \ - STDLIB_NDARRAY_EVERY_ND_LOOP_PREAMBLE { \ - const tin x = *(tin *)px1; \ - if ( !( f( cin( x ) ) ) ) { \ - *px2 = false; \ - return 0; \ - } \ - } \ - STDLIB_NDARRAY_EVERY_ND_LOOP_EPILOGUE - -#endif // !STDLIB_NDARRAY_BASE_EVERY_MACROS_ND_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x.h b/include/stdlib/ndarray/base/every/predicate/b_x.h deleted file mode 100644 index a0d434e..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x_as_c_x.h b/include/stdlib/ndarray/base/every/predicate/b_x_as_c_x.h deleted file mode 100644 index 7da63e8..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x_as_c_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_C_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_C_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_C_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x_as_d_x.h b/include/stdlib/ndarray/base/every/predicate/b_x_as_d_x.h deleted file mode 100644 index 2c3b429..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x_as_d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_D_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x_as_f_x.h b/include/stdlib/ndarray/base/every/predicate/b_x_as_f_x.h deleted file mode 100644 index 4cb9fe4..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x_as_f_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_F_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_F_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_F_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x_as_i_x.h b/include/stdlib/ndarray/base/every/predicate/b_x_as_i_x.h deleted file mode 100644 index 36abd9d..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x_as_i_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_I_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_I_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_I_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x_as_k_x.h b/include/stdlib/ndarray/base/every/predicate/b_x_as_k_x.h deleted file mode 100644 index 835da51..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x_as_k_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_K_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_K_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_K_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x_as_t_x.h b/include/stdlib/ndarray/base/every/predicate/b_x_as_t_x.h deleted file mode 100644 index 0c66d7e..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x_as_t_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_T_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_T_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_T_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x_as_u_x.h b/include/stdlib/ndarray/base/every/predicate/b_x_as_u_x.h deleted file mode 100644 index 1fb4bc1..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x_as_u_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_U_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_U_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_U_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/b_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/b_x_as_z_x.h deleted file mode 100644 index b65c3cb..0000000 --- a/include/stdlib/ndarray/base/every/predicate/b_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_B_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/c_x.h b/include/stdlib/ndarray/base/every/predicate/c_x.h deleted file mode 100644 index 655fc8c..0000000 --- a/include/stdlib/ndarray/base/every/predicate/c_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_C_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_C_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_C_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/c_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/c_x_as_z_x.h deleted file mode 100644 index 3c5ce5a..0000000 --- a/include/stdlib/ndarray/base/every/predicate/c_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_C_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_C_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_C_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/d_x.h b/include/stdlib/ndarray/base/every/predicate/d_x.h deleted file mode 100644 index 74908c2..0000000 --- a/include/stdlib/ndarray/base/every/predicate/d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_D_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/d_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/d_x_as_z_x.h deleted file mode 100644 index 3a11d06..0000000 --- a/include/stdlib/ndarray/base/every/predicate/d_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_D_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_D_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_D_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/f_x.h b/include/stdlib/ndarray/base/every/predicate/f_x.h deleted file mode 100644 index 6813198..0000000 --- a/include/stdlib/ndarray/base/every/predicate/f_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/f_x_as_c_x.h b/include/stdlib/ndarray/base/every/predicate/f_x_as_c_x.h deleted file mode 100644 index 9c5df02..0000000 --- a/include/stdlib/ndarray/base/every/predicate/f_x_as_c_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_C_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_C_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_C_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/f_x_as_d_x.h b/include/stdlib/ndarray/base/every/predicate/f_x_as_d_x.h deleted file mode 100644 index 04295c1..0000000 --- a/include/stdlib/ndarray/base/every/predicate/f_x_as_d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_D_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/f_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/f_x_as_z_x.h deleted file mode 100644 index ef08a63..0000000 --- a/include/stdlib/ndarray/base/every/predicate/f_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_F_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/i_x.h b/include/stdlib/ndarray/base/every/predicate/i_x.h deleted file mode 100644 index 9f2bc20..0000000 --- a/include/stdlib/ndarray/base/every/predicate/i_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/i_x_as_d_x.h b/include/stdlib/ndarray/base/every/predicate/i_x_as_d_x.h deleted file mode 100644 index a7e0d5a..0000000 --- a/include/stdlib/ndarray/base/every/predicate/i_x_as_d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_AS_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_AS_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_AS_D_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/i_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/i_x_as_z_x.h deleted file mode 100644 index 5b92d57..0000000 --- a/include/stdlib/ndarray/base/every/predicate/i_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_I_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/k_x.h b/include/stdlib/ndarray/base/every/predicate/k_x.h deleted file mode 100644 index fa043fe..0000000 --- a/include/stdlib/ndarray/base/every/predicate/k_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/k_x_as_c_x.h b/include/stdlib/ndarray/base/every/predicate/k_x_as_c_x.h deleted file mode 100644 index d12c96d..0000000 --- a/include/stdlib/ndarray/base/every/predicate/k_x_as_c_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_C_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_C_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_C_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/k_x_as_d_x.h b/include/stdlib/ndarray/base/every/predicate/k_x_as_d_x.h deleted file mode 100644 index 2f4045e..0000000 --- a/include/stdlib/ndarray/base/every/predicate/k_x_as_d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_D_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/k_x_as_f_x.h b/include/stdlib/ndarray/base/every/predicate/k_x_as_f_x.h deleted file mode 100644 index f3417ee..0000000 --- a/include/stdlib/ndarray/base/every/predicate/k_x_as_f_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_F_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_F_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_F_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/k_x_as_i_x.h b/include/stdlib/ndarray/base/every/predicate/k_x_as_i_x.h deleted file mode 100644 index cdaa6cf..0000000 --- a/include/stdlib/ndarray/base/every/predicate/k_x_as_i_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_I_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_I_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_I_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/k_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/k_x_as_z_x.h deleted file mode 100644 index 1ec08e1..0000000 --- a/include/stdlib/ndarray/base/every/predicate/k_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_K_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/s_x.h b/include/stdlib/ndarray/base/every/predicate/s_x.h deleted file mode 100644 index cb4b4da..0000000 --- a/include/stdlib/ndarray/base/every/predicate/s_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/s_x_as_c_x.h b/include/stdlib/ndarray/base/every/predicate/s_x_as_c_x.h deleted file mode 100644 index ba379ab..0000000 --- a/include/stdlib/ndarray/base/every/predicate/s_x_as_c_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_C_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_C_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_C_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/s_x_as_d_x.h b/include/stdlib/ndarray/base/every/predicate/s_x_as_d_x.h deleted file mode 100644 index 1768af8..0000000 --- a/include/stdlib/ndarray/base/every/predicate/s_x_as_d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_D_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/s_x_as_f_x.h b/include/stdlib/ndarray/base/every/predicate/s_x_as_f_x.h deleted file mode 100644 index f85ed09..0000000 --- a/include/stdlib/ndarray/base/every/predicate/s_x_as_f_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_F_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_F_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_F_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/s_x_as_i_x.h b/include/stdlib/ndarray/base/every/predicate/s_x_as_i_x.h deleted file mode 100644 index e6471c8..0000000 --- a/include/stdlib/ndarray/base/every/predicate/s_x_as_i_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_I_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_I_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_I_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/s_x_as_k_x.h b/include/stdlib/ndarray/base/every/predicate/s_x_as_k_x.h deleted file mode 100644 index 3979eb8..0000000 --- a/include/stdlib/ndarray/base/every/predicate/s_x_as_k_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_K_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_K_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_K_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/s_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/s_x_as_z_x.h deleted file mode 100644 index 64c5749..0000000 --- a/include/stdlib/ndarray/base/every/predicate/s_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_S_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/t_x.h b/include/stdlib/ndarray/base/every/predicate/t_x.h deleted file mode 100644 index d934729..0000000 --- a/include/stdlib/ndarray/base/every/predicate/t_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/t_x_as_c_x.h b/include/stdlib/ndarray/base/every/predicate/t_x_as_c_x.h deleted file mode 100644 index 75486d7..0000000 --- a/include/stdlib/ndarray/base/every/predicate/t_x_as_c_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_C_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_C_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_C_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/t_x_as_d_x.h b/include/stdlib/ndarray/base/every/predicate/t_x_as_d_x.h deleted file mode 100644 index fce7a26..0000000 --- a/include/stdlib/ndarray/base/every/predicate/t_x_as_d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_D_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/t_x_as_f_x.h b/include/stdlib/ndarray/base/every/predicate/t_x_as_f_x.h deleted file mode 100644 index 4a6b34d..0000000 --- a/include/stdlib/ndarray/base/every/predicate/t_x_as_f_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_F_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_F_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_F_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/t_x_as_i_x.h b/include/stdlib/ndarray/base/every/predicate/t_x_as_i_x.h deleted file mode 100644 index e3cce43..0000000 --- a/include/stdlib/ndarray/base/every/predicate/t_x_as_i_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_I_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_I_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_I_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/t_x_as_u_x.h b/include/stdlib/ndarray/base/every/predicate/t_x_as_u_x.h deleted file mode 100644 index 21f3433..0000000 --- a/include/stdlib/ndarray/base/every/predicate/t_x_as_u_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_U_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_U_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_U_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/t_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/t_x_as_z_x.h deleted file mode 100644 index c3ebdd5..0000000 --- a/include/stdlib/ndarray/base/every/predicate/t_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_T_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/u_x.h b/include/stdlib/ndarray/base/every/predicate/u_x.h deleted file mode 100644 index b44b99a..0000000 --- a/include/stdlib/ndarray/base/every/predicate/u_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/u_x_as_d_x.h b/include/stdlib/ndarray/base/every/predicate/u_x_as_d_x.h deleted file mode 100644 index a23f385..0000000 --- a/include/stdlib/ndarray/base/every/predicate/u_x_as_d_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_AS_D_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_AS_D_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_AS_D_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/u_x_as_z_x.h b/include/stdlib/ndarray/base/every/predicate/u_x_as_z_x.h deleted file mode 100644 index 54c62c7..0000000 --- a/include/stdlib/ndarray/base/every/predicate/u_x_as_z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_AS_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_AS_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_U_X_AS_Z_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/x_x.h b/include/stdlib/ndarray/base/every/predicate/x_x.h deleted file mode 100644 index eaf71e7..0000000 --- a/include/stdlib/ndarray/base/every/predicate/x_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_X_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_X_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_x_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_X_X_H diff --git a/include/stdlib/ndarray/base/every/predicate/z_x.h b/include/stdlib/ndarray/base/every/predicate/z_x.h deleted file mode 100644 index a09602b..0000000 --- a/include/stdlib/ndarray/base/every/predicate/z_x.h +++ /dev/null @@ -1,150 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_Z_X_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_Z_X_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_z_x_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_Z_X_H diff --git a/include/stdlib/ndarray/base/every/typedefs.h b/include/stdlib/ndarray/base/every/typedefs.h deleted file mode 100644 index 823cf1a..0000000 --- a/include/stdlib/ndarray/base/every/typedefs.h +++ /dev/null @@ -1,38 +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. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_TYPEDEFS_H -#define STDLIB_NDARRAY_BASE_EVERY_TYPEDEFS_H - -#include "stdlib/ndarray/ctor.h" -#include - -/** -* Function pointer type for an ndarray function. -* -* ## Note -* -* - This must match the definition of an `ndarrayFcn` found in `@stdlib/ndarray/base/function-object`. -* -* @param arrays array containing pointers to the input and output ndarrays -* @param data function "data" (e.g., a callback) -* @return status code -*/ -typedef int8_t (*ndarrayEveryFcn)( struct ndarray *arrays[], void *data ); - -#endif // !STDLIB_NDARRAY_BASE_EVERY_TYPEDEFS_H diff --git a/index.js b/index.js new file mode 100644 index 0000000..a88990c --- /dev/null +++ b/index.js @@ -0,0 +1,3 @@ +// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(r="undefined"!=typeof globalThis?globalThis:r||self).every=t()}(this,(function(){"use strict";var r=8,t=16;var e=1;var n="function"==typeof Object.defineProperty?Object.defineProperty:null;var o=Object.defineProperty;function i(r){return"number"==typeof r}function a(r){var t,e="";for(t=0;t0&&(e-=1),n=r.toExponential(e)):n=r.toPrecision(t.precision),t.alternate||(n=y.call(n,E,"$1e"),n=y.call(n,b,"e"),n=y.call(n,w,""));break;default:throw new Error("invalid double notation. Value: "+t.specifier)}return n=y.call(n,g,"e+0$1"),n=y.call(n,m,"e-0$1"),t.alternate&&(n=y.call(n,v,"$1."),n=y.call(n,d,"$1.e")),r>=0&&t.sign&&(n=t.sign+n),n=t.specifier===p.call(t.specifier)?p.call(n):c.call(n)}function T(r){var t,e="";for(t=0;t127)throw new Error("invalid character code. Value: "+n.arg);n.arg=A(a)?String(n.arg):x(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(t||(n.precision=6),h=parseFloat(n.arg),!isFinite(h)){if(!i(n.arg))throw new Error("invalid floating-point number. Value: "+u);h=n.arg,n.padZeros=!1}n.arg=_(h,n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=f(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(y=n.arg,g=n.width,m=n.padRight,v=void 0,(v=g-y.length)<0?y:y=m?y+T(v):T(v)+y)),u+=n.arg||"",s+=1}return u}var F=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function L(r){var t={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(t.precision="1"),t}function O(r){var t,e,n,o;for(e=[],o=0,n=F.exec(r);n;)(t=r.slice(o,F.lastIndex-n[0].length)).length&&e.push(t),"%"===n[6]?e.push("%"):e.push(L(n)),o=F.lastIndex,n=F.exec(r);return(t=r.slice(o)).length&&e.push(t),e}function I(r){var t,e;if("string"!=typeof r)throw new TypeError(I("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[O(r)],e=1;e0?i+=a*(r[f]-1):a<0&&(o+=a*(r[f]-1))}return[o,i]}Y(W,"assign",(function(r,t,e,n){var o,i,a,f,u;for(o=r.length,i=e,a=e,u=0;u0?a+=f*(r[u]-1):f<0&&(i+=f*(r[u]-1))}return n[0]=i,n[1]=a,n}));var Z="function";function $(r){return typeof r.get===Z&&typeof r.set===Z}var G={complex128:function(r,t){return r.get(t)},complex64:function(r,t){return r.get(t)},default:function(r,t){return r.get(t)}};function K(r){var t=G[r];return"function"==typeof t?t:G.default}var X={complex128:function(r,t,e){r.set(e,t)},complex64:function(r,t,e){r.set(e,t)},default:function(r,t,e){r.set(e,t)}};function z(r){var t=X[r];return"function"==typeof t?t:X.default}var H={float64:function(r,t){return r[t]},float32:function(r,t){return r[t]},int32:function(r,t){return r[t]},int16:function(r,t){return r[t]},int8:function(r,t){return r[t]},uint32:function(r,t){return r[t]},uint16:function(r,t){return r[t]},uint8:function(r,t){return r[t]},uint8c:function(r,t){return r[t]},generic:function(r,t){return r[t]},default:function(r,t){return r[t]}};function J(r){var t=H[r];return"function"==typeof t?t:H.default}var D={float64:function(r,t,e){r[t]=e},float32:function(r,t,e){r[t]=e},int32:function(r,t,e){r[t]=e},int16:function(r,t,e){r[t]=e},int8:function(r,t,e){r[t]=e},uint32:function(r,t,e){r[t]=e},uint16:function(r,t,e){r[t]=e},uint8:function(r,t,e){r[t]=e},uint8c:function(r,t,e){r[t]=e},generic:function(r,t,e){r[t]=e},default:function(r,t,e){r[t]=e}};function q(r){var t=D[r];return"function"==typeof t?t:D.default}function Q(r){var t,e,n;if(0===(t=r.length))return 0;for(e=1,n=0;n=0;o--)e[o]=n,n*=r[o];return e}(r)}Y(pr,"isPrimitive",tr),Y(pr,"isObject",cr),Y(gr,"assign",(function(r,t,e){return yr(t)?function(r,t){var e,n;for(e=1,n=0;n=0;n--)t[n]=e,e*=r[n];return t}(r,e)}));var mr="row-major";function vr(r,t){var e,n,o;return"object"!=typeof(o=r.strides)||null===o?0===(n=r.shape).length?[0]:(tr(e=r.order)||(e=mr),gr(n,e)):t?rr(o):o}function dr(r){return"number"==typeof r}var wr=Number,br=wr.prototype.toString;var Er=nr();function _r(r){return"object"==typeof r&&(r instanceof wr||(Er?function(r){try{return br.call(r),!0}catch(r){return!1}}(r):"[object Number]"===sr(r)))}function Tr(r){return dr(r)||_r(r)}function xr(r){var t,e,n;return dr(n=r.offset)?n:0===(e=r.shape).length||"object"!=typeof(t=r.strides)||null===t?0:function(r,t){var e,n,o;for(n=r.length,e=0,o=0;oo&&(n=!1),!n&&!t)return 0;o=i}return n&&t?3:n?1:2}Y(Tr,"isPrimitive",dr),Y(Tr,"isObject",_r);var jr="row-major",Sr="column-major";function Fr(r){var t,e;return tr(e=r.order)?e:"object"!=typeof(t=r.strides)||null===t||1===(e=Ar(t))||3===e?jr:2===e?Sr:0===r.shape.length?jr:null}function Lr(r){var t,e,n,o;return t=function(r){return r.data}(r),n=function(r,t){var e=r.shape;return t?rr(e):e}(r,!0),o=function(r){return r.dtype}(r),e=$(t),{ref:r,dtype:o,data:t,length:Q(n),shape:n,strides:vr(r,!0),offset:xr(r),order:Fr(r),accessorProtocol:e,accessors:e?[K(o),z(o)]:[J(o),q(o)]}}var Or=16;function Ir(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Or}var kr=8;function Br(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===kr}var Rr="function"==typeof Float64Array;var Pr="function"==typeof Float64Array?Float64Array:null;var Mr,Cr="function"==typeof Float64Array?Float64Array:void 0;Mr=function(){var r,t,e;if("function"!=typeof Pr)return!1;try{t=new Pr([1,3.14,-3.14,NaN]),e=t,r=(Rr&&e instanceof Float64Array||"[object Float64Array]"===sr(e))&&1===t[0]&&3.14===t[1]&&-3.14===t[2]&&t[3]!=t[3]}catch(t){r=!1}return r}()?Cr:function(){throw new Error("not implemented")};var Nr=Mr;function Ur(r,t){return new Nr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}var Yr="function"==typeof Float32Array;var Wr=Number.POSITIVE_INFINITY,Zr="function"==typeof Float32Array?Float32Array:null;var $r,Gr="function"==typeof Float32Array?Float32Array:void 0;$r=function(){var r,t,e;if("function"!=typeof Zr)return!1;try{t=new Zr([1,3.14,-3.14,5e40]),e=t,r=(Yr&&e instanceof Float32Array||"[object Float32Array]"===sr(e))&&1===t[0]&&3.140000104904175===t[1]&&-3.140000104904175===t[2]&&t[3]===Wr}catch(t){r=!1}return r}()?Gr:function(){throw new Error("not implemented")};var Kr=$r;function Xr(r,t){return new Kr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}var zr="function"==typeof Uint8Array;var Hr="function"==typeof Uint8Array?Uint8Array:null;var Jr,Dr="function"==typeof Uint8Array?Uint8Array:void 0;Jr=function(){var r,t,e;if("function"!=typeof Hr)return!1;try{t=new Hr(t=[1,3.14,-3.14,256,257]),e=t,r=(zr&&e instanceof Uint8Array||"[object Uint8Array]"===sr(e))&&1===t[0]&&3===t[1]&&253===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?Dr:function(){throw new Error("not implemented")};var qr=Jr;var Qr=Array.isArray?Array.isArray:function(r){return"[object Array]"===sr(r)};function rt(r){if("function"!=typeof r)throw new TypeError(I("invalid argument. Must provide a function. Value: `%s`.",r));return function(t){var e,n;if(!Qr(t))return!1;if(0===(e=t.length))return!1;for(n=0;nCt&&Ut(r)}function Wt(r){return dr(r)&&Yt(r)}function Zt(r){return _r(r)&&Yt(r.valueOf())}function $t(r){return Wt(r)||Zt(r)}function Gt(r){return Wt(r)&&r>=0}function Kt(r){return Zt(r)&&r.valueOf()>=0}function Xt(r){return Gt(r)||Kt(r)}Y($t,"isPrimitive",Wt),Y($t,"isObject",Zt),Y(Xt,"isPrimitive",Gt),Y(Xt,"isObject",Kt);var zt=4294967295;function Ht(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&Ut(r.length)&&r.length>=0&&r.length<=zt}var Jt=9007199254740991;function Dt(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&Ut(r.length)&&r.length>=0&&r.length<=Jt}var qt="function"==typeof ArrayBuffer;function Qt(r){return qt&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===sr(r)}function re(r){return"object"==typeof r&&null!==r&&!Qr(r)}var te=rt(pr.isPrimitive),ee=rt(pr.isObject),ne=rt(pr);Y(ne,"primitives",te),Y(ne,"objects",ee);var oe=/./;function ie(r){return"boolean"==typeof r}var ae=Boolean,fe=Boolean.prototype.toString;var ue=nr();function se(r){return"object"==typeof r&&(r instanceof ae||(ue?function(r){try{return fe.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===sr(r)))}function le(r){return ie(r)||se(r)}Y(le,"isPrimitive",ie),Y(le,"isObject",se);var he="object"==typeof self?self:null,ce="object"==typeof window?window:null,pe="object"==typeof global?global:null,ye="object"==typeof globalThis?globalThis:null;var ge=function(r){if(arguments.length){if(!ie(r))throw new TypeError(I("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(ye)return ye;if(he)return he;if(ce)return ce;if(pe)return pe;throw new Error("unexpected error. Unable to resolve global object.")}(),me=ge.document&&ge.document.childNodes,ve=Int8Array;var de="function"==typeof oe||"object"==typeof ve||"function"==typeof me?function(r){return it(r).toLowerCase()}:function(r){var t;return null===r?"null":"object"===(t=typeof r)?it(r).toLowerCase():t};function we(r){return"function"===de(r)}function be(r,t,e){U(r,t,{configurable:!1,enumerable:!0,writable:!1,value:e})}function Ee(r,t){if(!(this instanceof Ee))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!dr(r))throw new TypeError(I("invalid argument. Real component must be a number. Value: `%s`.",r));if(!dr(t))throw new TypeError(I("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return be(this,"re",r),be(this,"im",t),this}Y(Ee,"name","Complex128"),Y(Ee,"BYTES_PER_ELEMENT",8),Y(Ee.prototype,"BYTES_PER_ELEMENT",8),Y(Ee.prototype,"byteLength",16),Y(Ee.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),Y(Ee.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var _e="function"==typeof Math.fround?Math.fround:null,Te=new Kr(1);var xe="function"==typeof _e?_e:function(r){return Te[0]=r,Te[0]};function Ve(r,t){if(!(this instanceof Ve))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!dr(r))throw new TypeError(I("invalid argument. Real component must be a number. Value: `%s`.",r));if(!dr(t))throw new TypeError(I("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return be(this,"re",xe(r)),be(this,"im",xe(t)),this}function Ae(r){return r instanceof Ee||r instanceof Ve||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function je(r){return Ut(r/2)}function Se(){return"function"==typeof fr&&"symbol"==typeof fr("foo")&&ar(fr,"iterator")&&"symbol"==typeof fr.iterator}Y(Ve,"name","Complex64"),Y(Ve,"BYTES_PER_ELEMENT",4),Y(Ve.prototype,"BYTES_PER_ELEMENT",4),Y(Ve.prototype,"byteLength",8),Y(Ve.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),Y(Ve.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Fe=Se()?Symbol.iterator:null;function Le(r,t,e){U(r,t,{configurable:!1,enumerable:!1,get:e})}function Oe(r){return r.re}function Ie(r){return r.im}function ke(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(Ht(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!Ae(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(Oe(n),Ie(n))}return t}var Be=2*Kr.BYTES_PER_ELEMENT,Re=Se();function Pe(r){return r instanceof Ne||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Me(r){return r===Ne||"Complex128Array"===r.name}function Ce(r,t){return new Ve(r[t*=2],r[t+1])}function Ne(){var r,t,e,n;if(t=arguments.length,!(this instanceof Ne))return 0===t?new Ne:1===t?new Ne(arguments[0]):2===t?new Ne(arguments[0],arguments[1]):new Ne(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Kr(0);else if(1===t)if(Gt(arguments[0]))e=new Kr(2*arguments[0]);else if(Dt(arguments[0]))if((n=(e=arguments[0]).length)&&Qr(e)&&Ae(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*Be));e=new Kr(e,r,2*n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length/2),this}function Ue(r){return r.re}function Ye(r){return r.im}function We(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(Ht(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!Ae(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(Ue(n),Ye(n))}return t}Y(Ne,"BYTES_PER_ELEMENT",Be),Y(Ne,"name","Complex64Array"),Y(Ne,"from",(function(r){var t,e,n,o,i,a,f,u,s,l,h,c;if(!we(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Me(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!we(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Pe(r)){if(u=r.length,n){for(i=(o=new this(u))._buffer,c=0,h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(re(r)&&Re&&we(r[Fe])){if(!we((i=r[Fe]()).next))throw new TypeError(I("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,t,e){var n,o,i,a;for(n=[],a=-1;!(o=r.next()).done;)if(a+=1,Ht(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!Ae(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(Oe(i),Ie(i))}return n}(i,n,t):ke(i),a instanceof Error)throw a;for(i=(o=new this(u=a.length/2))._buffer,h=0;h=this._length))return Ce(this._buffer,r)})),Le(Ne.prototype,"buffer",(function(){return this._buffer.buffer})),Le(Ne.prototype,"byteLength",(function(){return this._buffer.byteLength})),Le(Ne.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(Ne.prototype,"BYTES_PER_ELEMENT",Ne.BYTES_PER_ELEMENT),Y(Ne.prototype,"copyWithin",(function(r,t){if(!Pe(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(Ne.prototype,"entries",(function(){var r,t,e,n,o,i;if(!Pe(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(){if(i+=1,o||i>=e)return{done:!0};return{value:[i,Ce(n,i)],done:!1}})),Y(t,"return",(function(r){if(o=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(t,Fe,(function(){return r.entries()})),t})),Y(Ne.prototype,"every",(function(r,t){var e,n;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!we(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Ut(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(a=Oe(r),f=Ie(r),u=t;u=0;n--)if(o=Ce(e,n),r.call(t,o,n,this))return o})),Y(Ne.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!we(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=Ce(e,n),r.call(t,o,n,this))return n;return-1})),Y(Ne.prototype,"forEach",(function(r,t){var e,n,o;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!we(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 Ce(this._buffer,r)})),Y(Ne.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ae(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Oe(r),i=Ie(r),e=this._buffer,a=t;a1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Oe(r),i=Ie(r),e=this._buffer,a=t;a=e)return{done:!0};return{value:o,done:!1}})),Y(t,"return",(function(r){if(n=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(t,Fe,(function(){return r.keys()})),t})),Y(Ne.prototype,"lastIndexOf",(function(r,t){var e,n,o,i,a;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ae(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(o=Oe(r),i=Ie(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),Le(Ne.prototype,"length",(function(){return this._length})),Y(Ne.prototype,"map",(function(r,t){var e,n,o,i,a;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!we(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=Ce(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=Ce(e,o-1),i=o-2}for(;i>=0;i--)n=r(n,Ce(e,i),i,this);return n})),Y(Ne.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ae(r)){if(e>=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Oe(r),void(n[e+1]=Ie(r))}if(Pe(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*Be,t.buffer===n.buffer&&t.byteOffsets){for(o=new Kr(t.length),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,s=n.byteOffset+e*Be,t.buffer===n.buffer&&t.byteOffsets){for(o=new Kr(a),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,u=0;uf&&(t=f)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*Be):(o=t-r,e=n.byteOffset+r*Be),new this.constructor(n.buffer,e,o<0?0:o)})),Y(Ne.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!tr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e)return{done:!0};return{value:Ce(o,i),done:!1}})),Y(r,"return",(function(r){if(n=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(r,Fe,(function(){return t.values()})),r})),Y(Ne.prototype,"with",(function(r,t){var e,n,o;if(!Pe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(o=this._length,r<0&&(r+=o),r<0||r>=o)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Ae(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]=Oe(t),e[2*r+1]=Ie(t),n}));var Ze=2*Nr.BYTES_PER_ELEMENT,$e=Se();function Ge(r){return r instanceof ze||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Ke(r){return r===ze||"Complex64Array"===r.name}function Xe(r,t){return new Ee(r[t*=2],r[t+1])}function ze(){var r,t,e,n;if(t=arguments.length,!(this instanceof ze))return 0===t?new ze:1===t?new ze(arguments[0]):2===t?new ze(arguments[0],arguments[1]):new ze(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Nr(0);else if(1===t)if(Gt(arguments[0]))e=new Nr(2*arguments[0]);else if(Dt(arguments[0]))if((n=(e=arguments[0]).length)&&Qr(e)&&Ae(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*Ze));e=new Nr(e,r,2*n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length/2),this}function He(r){var t,e;for(t=[];!(e=r.next()).done;)t.push(ae(e.value));return t}Y(ze,"BYTES_PER_ELEMENT",Ze),Y(ze,"name","Complex128Array"),Y(ze,"from",(function(r){var t,e,n,o,i,a,f,u,s,l,h,c;if(!we(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ke(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!we(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Ge(r)){if(u=r.length,n){for(i=(o=new this(u))._buffer,c=0,h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),h=0;h=2))throw new TypeError(I("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(re(r)&&$e&&we(r[Fe])){if(!we((i=r[Fe]()).next))throw new TypeError(I("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,t,e){var n,o,i,a;for(n=[],a=-1;!(o=r.next()).done;)if(a+=1,Ht(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!Ae(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(Ue(i),Ye(i))}return n}(i,n,t):We(i),a instanceof Error)throw a;for(i=(o=new this(u=a.length/2))._buffer,h=0;h=this._length))return Xe(this._buffer,r)})),Le(ze.prototype,"buffer",(function(){return this._buffer.buffer})),Le(ze.prototype,"byteLength",(function(){return this._buffer.byteLength})),Le(ze.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(ze.prototype,"BYTES_PER_ELEMENT",ze.BYTES_PER_ELEMENT),Y(ze.prototype,"copyWithin",(function(r,t){if(!Ge(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(ze.prototype,"entries",(function(){var r,t,e,n,o,i,a;if(!Ge(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;if(i+=1,o||i>=n)return{done:!0};return t=new Ee(r[a+=2],r[a+1]),{value:[i,t],done:!1}})),Y(e,"return",(function(r){if(o=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(e,Fe,(function(){return t.entries()})),e})),Y(ze.prototype,"every",(function(r,t){var e,n;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!we(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Ut(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(a=Ue(r),f=Ye(r),u=t;u=0;n--)if(o=Xe(e,n),r.call(t,o,n,this))return o})),Y(ze.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!we(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=Xe(e,n),r.call(t,o,n,this))return n;return-1})),Y(ze.prototype,"forEach",(function(r,t){var e,n,o;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!we(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 Xe(this._buffer,r)})),Le(ze.prototype,"length",(function(){return this._length})),Y(ze.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ae(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Ue(r),i=Ye(r),e=this._buffer,a=t;a1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=Ue(r),i=Ye(r),e=this._buffer,a=t;a=e)return{done:!0};return{value:o,done:!1}})),Y(t,"return",(function(r){if(n=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(t,Fe,(function(){return r.keys()})),t})),Y(ze.prototype,"lastIndexOf",(function(r,t){var e,n,o,i,a;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ae(r))throw new TypeError(I("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ut(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(o=Ue(r),i=Ye(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),Y(ze.prototype,"map",(function(r,t){var e,n,o,i,a;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!we(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=Xe(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=Xe(e,o-1),i=o-2}for(;i>=0;i--)n=r(n,Xe(e,i),i,this);return n})),Y(ze.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Ae(r)){if(e>=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Ue(r),void(n[e+1]=Ye(r))}if(Ge(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*Ze,t.buffer===n.buffer&&t.byteOffsets){for(o=new Nr(t.length),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,s=n.byteOffset+e*Ze,t.buffer===n.buffer&&t.byteOffsets){for(o=new Nr(a),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,u=0;uf&&(t=f)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*Ze):(o=t-r,e=n.byteOffset+r*Ze),new this.constructor(n.buffer,e,o<0?0:o)})),Y(ze.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!pr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e)return{done:!0};return{value:Xe(o,i),done:!1}})),Y(r,"return",(function(r){if(n=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(r,Fe,(function(){return t.values()})),r})),Y(ze.prototype,"with",(function(r,t){var e,n,o;if(!Ge(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(o=this._length,r<0&&(r+=o),r<0||r>=o)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Ae(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]=Ue(t),e[2*r+1]=Ye(t),n}));var Je=qr.BYTES_PER_ELEMENT,De=Se();function qe(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===Je}function Qe(r){return r===rn}function rn(){var r,t,e,n,o;if(t=arguments.length,!(this instanceof rn))return 0===t?new rn:1===t?new rn(arguments[0]):2===t?new rn(arguments[0],arguments[1]):new rn(arguments[0],arguments[1],arguments[2]);if(0===t)e=new qr(0);else if(1===t)if(Gt(o=arguments[0]))e=new qr(o);else if(Dt(o))e=function(r,t){var e,n;for(e=t.length,n=0;ne.byteLength-r)throw new RangeError(I("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Je));e=new qr(e,r,n)}}return Y(this,"_buffer",e),Y(this,"_length",e.length),this}Y(rn,"BYTES_PER_ELEMENT",Je),Y(rn,"name","BooleanArray"),Y(rn,"from",(function(r){var t,e,n,o,i,a,f,u,s;if(!we(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(!we(n=arguments[1]))throw new TypeError(I("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Dt(r)){if(n){for(u=r.length,f=r.get&&r.set?K("default"):J("default"),i=(o=new this(u))._buffer,s=0;s=e))return ae(t[r])})),Le(rn.prototype,"buffer",(function(){return this._buffer.buffer})),Le(rn.prototype,"byteLength",(function(){return this._buffer.byteLength})),Le(rn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),Y(rn.prototype,"BYTES_PER_ELEMENT",rn.BYTES_PER_ELEMENT),Y(rn.prototype,"copyWithin",(function(r,t){if(!qe(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(rn.prototype,"entries",(function(){var r,t,e,n,o,i;if(!qe(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(){if(i+=1,o||i>=e)return{done:!0};return{value:[i,ae(n[i])],done:!1}})),Y(t,"return",(function(r){if(o=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(t,Fe,(function(){return r.entries()})),t})),Y(rn.prototype,"every",(function(r,t){var e,n;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!we(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Wt(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(i=r?1:0,a=t;a=0;o--)if(n=ae(e[o]),r.call(t,n,o,this))return n})),Y(rn.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!we(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,o=this._length-1;o>=0;o--)if(n=ae(e[o]),r.call(t,n,o,this))return o;return-1})),Y(rn.prototype,"forEach",(function(r,t){var e,n;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!we(r))throw new TypeError(I("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return ae(this._buffer[r])})),Y(rn.prototype,"includes",(function(r,t){var e,n;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ie(r))throw new TypeError(I("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(e=this._buffer,n=t;n1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(e=this._buffer,n=t;n0){if(!tr(r))throw new TypeError(I("invalid argument. First argument must be a string. Value: `%s`.",r))}else r=",";for(t=this._buffer,e=[],n=0;n=e)return{done:!0};return{value:o,done:!1}})),Y(t,"return",(function(r){if(n=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(t,Fe,(function(){return r.keys()})),t})),Y(rn.prototype,"lastIndexOf",(function(r,t){var e,n;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ie(r))throw new TypeError(I("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(e=this._buffer,n=t;n>=0;n--)if(r===ae(e[n]))return n;return-1})),Le(rn.prototype,"length",(function(){return this._length})),Y(rn.prototype,"map",(function(r,t){var e,n,o,i;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!we(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(o=this._buffer,e=(n=new this.constructor(this._length))._buffer,i=0;i1)o=t,i=0;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");o=ae(e[0]),i=1}for(;i1)o=t,i=n-1;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");o=ae(e[n-1]),i=n-2}for(;i>=0;i--)o=r(o,ae(e[i]),i,this);return o})),Y(rn.prototype,"reverse",(function(){var r,t,e,n,o,i;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,e=this._length,n=Nt(e/2),o=0;o1){if(!Gt(e=arguments[1]))throw new TypeError(I("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Dt(r)){if(e+(i=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=qe(r)?r._buffer:r,f=n.byteOffset+e*Je,t.buffer===n.buffer&&t.byteOffsetf){for(o=new qr(t.length),a=0;a=this._length)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));n[e]=r?1:0}})),Y(rn.prototype,"slice",(function(r,t){var e,n,o,i,a,f;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(i=this._buffer,a=this._length,0===arguments.length)r=0,t=a;else{if(!Wt(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a)<0&&(r=0),1===arguments.length)t=a;else{if(!Wt(t))throw new TypeError(I("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a)<0&&(t=0):t>a&&(t=a)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*Je):(o=t-r,e=n.byteOffset+r*Je),new this.constructor(n.buffer,e,o<0?0:o)})),Y(rn.prototype,"toLocaleString",(function(r,t){var e,n,o,i,a;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)n=[];else{if(!tr(r)&&!te(r))throw new TypeError(I("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)e={};else{if(!re(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(i=this._buffer,o=[],a=0;a=e)return{done:!0};return{value:ae(o[i]),done:!1}})),Y(r,"return",(function(r){if(n=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Fe&&Y(r,Fe,(function(){return t.values()})),r})),Y(rn.prototype,"with",(function(r,t){var e,n;if(!qe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Wt(r))throw new TypeError(I("invalid argument. First argument must be an integer. Value: `%s`.",r));if(n=this._length,r<0&&(r+=n),r<0||r>=n)throw new RangeError(I("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ie(t))throw new TypeError(I("invalid argument. Second argument must be a boolean. Value: `%s`.",t));return(e=new this.constructor(this._buffer))._buffer[r]=t?1:0,e}));var tn=[Nr,Kr,vt,ct,jt,_t,Mt,qr,It,Ne,ze,rn],en=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],nn=en.length;function on(r){var t=function(r){var t;if(Qr(r))return"generic";if(et(r))return null;for(t=0;t0)for(l=0;l0)for(u=0;u0?0:(1-r)*t}(r,n))}function ln(r){var t,e;if(t=[],r<=0)return t;for(e=0;e=0&&a=0&&!(((s=r[i])<0?-s:s)<=e);)r[i+1]=s,t[a+1]=t[a],i-=1,a-=1;r[i+1]=f,t[a+1]=u,n+=1,o+=1}}(t=rr(t),e),{sh:r=function(r,t){var e,n;for(e=[],n=0;n0}function yn(r){return Zt(r)&&r.valueOf()>0}function gn(r){return pn(r)||yn(r)}function mn(r){return Object.keys(Object(r))}Y(sn,"ndarray",un),Y(ln,"assign",(function(r,t,e){var n=on(r);return n.accessorProtocol?"complex128"===n.dtype?hn(r,Ur(r,0),t,e):"complex64"===n.dtype?hn(r,Xr(r,0),t,e):function(r,t,e){var n,o,i,a;for(n=r.data,o=r.accessors[1],a=e,i=0;a>=0&&a=0&&o=0&&t=0&&r.length<=ut&&ar(r,"callee")&&!jn(r,"callee")},Fn=Array.prototype.slice;var Ln=jn((function(){}),"prototype"),On=!jn({toString:null},"toString");function In(r,t,e){var n,o;if(!Dt(r)&&!tr(r))throw new TypeError(I("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(0===(n=r.length))return-1;if(3===arguments.length){if(!Wt(e))throw new TypeError(I("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=n)return-1;o=e}else(o=n+e)<0&&(o=0)}else o=0;if(xn(t)){for(;o0&&!ar(r,"0"))for(f=0;f1){if(!Kn(t))throw new TypeError(I("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ar(t,"duplicates")&&!ie(s=t.duplicates))throw new TypeError(I("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",s))}if(n=(e=Yn(r)).length,a={},s)for(u=0;ut&&(t=n)}return(n=Jn.BLOCK_SIZE_IN_BYTES/t|0)>0?n:1}([r])}function qn(r,t,e,n,o,i){var a,f,u,s,l;for(a=r.length,f=1,l=0;l=f&&(o=f-1);else if("wrap"===i)o<0?(o+=f)<0&&0!==(o%=f)&&(o+=f):o>=f&&(o-=f)>=f&&(o%=f);else if("normalize"===i&&o<0&&(o+=f),o<0||o>=f)throw new RangeError(I("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",f,o));if(u=e,yr(n)){for(l=0;l=0;l--)o-=s=o%r[l],o/=r[l],u+=s*t[l];return u}var Qn="throw";var ro="throw";var to="throw";var eo=[function(r){return!!r.data[r.offset]},function(r){var t,e,n,o,i;for(n=r.shape[0],e=r.strides[0],o=r.offset,t=r.data,i=0;i0;)for(g0;)for(y0;)for(b0;)for(w0;)for(d0;)for(V0;)for(x0;)for(T0;)for(_0;)for(L0;)for(F0;)for(S0;)for(j0;)for(A0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(L0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(B0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(m0;)for(g0;)for(E0;)for(b0;)for(w0;)for(A0;)for(V0;)for(x0;)for(T0;)for(O0;)for(L0;)for(F0;)for(S0;)for(j0;)for(P0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(er0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(g0;)for(y0;)for(b0;)for(w0;)for(d0;)for(V0;)for(x0;)for(T0;)for(_0;)for(L0;)for(F0;)for(S0;)for(j0;)for(A0;)for(R0;)for(B0;)for(k0;)for(I0;)for(O0;)for(L0;)for(U0;)for(N0;)for(C0;)for(M0;)for(P0;)for(R0;)for(B0;)for(G0;)for($0;)for(Z0;)for(W0;)for(Y0;)for(U0;)for(N0;)for(C0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K0;)for(G0;)for($0;)for(Z0;)for(W0;)for(tr0;)for(rr0;)for(Q0;)for(q0;)for(D0;)for(J0;)for(H0;)for(z0;)for(X0;)for(K 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport isNumber from './is_number.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar f;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\tf = parseFloat( token.arg );\n\t\t\t\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\t\t\t\tif ( !isNumber( token.arg ) ) {\n\t\t\t\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t\t\t\t}\n\t\t\t\t\t// Case: NaN, Infinity, or -Infinity\n\t\t\t\t\tf = token.arg;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( f, token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\t// Check for an escaped percent sign `%%`...\n\t\tif ( match[ 6 ] === '%' ) {\n\t\t\ttokens.push( '%' );\n\t\t} else {\n\t\t\ttokens.push( parse( match ) );\n\t\t}\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils-define-property\n*\n* @example\n* import defineProperty from '@stdlib/utils-define-property';\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nimport hasDefinePropertySupport from './has_define_property_support.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './define_property.js';\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @param {NonNegativeInteger} offset - index offset\n* @returns {Array} linear indices\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*/\nfunction minmaxViewBufferIndex( shape, strides, offset ) {\n\tvar ndims;\n\tvar min;\n\tvar max;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tmin = offset;\n\tmax = offset;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( shape[ i ] === 0 ) {\n\t\t\treturn [ offset, offset ];\n\t\t}\n\t\ts = strides[ i ];\n\t\tif ( s > 0 ) {\n\t\t\tmax += s * ( shape[i]-1 );\n\t\t} else if ( s < 0 ) {\n\t\t\tmin += s * ( shape[i]-1 ); // decrements min\n\t\t}\n\t}\n\treturn [ min, max ];\n}\n\n\n// EXPORTS //\n\nexport default minmaxViewBufferIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view.\n*\n* @module @stdlib/ndarray-base-minmax-view-buffer-index\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 10, 109 ]\n*\n* @example\n* import minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\n*\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var idx = minmaxViewBufferIndex( shape, strides, offset );\n* // returns [ 0, 99 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the minimum and maximum linear indices in an underlying data buffer which are accessible to an array view and assigns results to a provided output array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @param {NonNegativeInteger} offset - index offset\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} linear indices\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 10, 1 ];\n* var offset = 10;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 10, 109 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -10, -1 ];\n* var offset = 99;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 0, 99 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ 1, 10 ];\n* var offset = 10;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 10, 109 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*\n* @example\n* var shape = [ 10, 10 ];\n* var strides = [ -1, -10 ];\n* var offset = 99;\n*\n* var out = [ 0, 0 ];\n* var idx = minmaxViewBufferIndex( shape, strides, offset, out );\n* // returns [ 0, 99 ]\n*\n* var bool = ( idx === out );\n* // returns true\n*/\nfunction minmaxViewBufferIndex( shape, strides, offset, out ) {\n\tvar ndims;\n\tvar min;\n\tvar max;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tmin = offset;\n\tmax = offset;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( shape[ i ] === 0 ) {\n\t\t\tout[ 0 ] = offset;\n\t\t\tout[ 1 ] = offset;\n\t\t\treturn out;\n\t\t}\n\t\ts = strides[ i ];\n\t\tif ( s > 0 ) {\n\t\t\tmax += s * ( shape[i]-1 );\n\t\t} else if ( s < 0 ) {\n\t\t\tmin += s * ( shape[i]-1 ); // decrements min\n\t\t}\n\t}\n\tout[ 0 ] = min;\n\tout[ 1 ] = max;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default minmaxViewBufferIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the number of elements in an array.\n*\n* @param {(NonNegativeIntegerArray|EmptyArray)} shape - array shape\n* @returns {NonNegativeInteger} number of elements\n*\n* @example\n* var n = numel( [ 3, 3, 3 ] );\n* // returns 27\n*/\nfunction numel( shape ) {\n\tvar ndims;\n\tvar n;\n\tvar i;\n\n\tndims = shape.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0;\n\t}\n\tn = 1;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tn *= shape[ i ];\n\t}\n\treturn n;\n}\n\n\n// EXPORTS //\n\nexport default numel;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tlen = x.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( x[ i ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default copy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasSymbols from '@stdlib/assert-has-symbol-support';\n\n\n// VARIABLES //\n\nvar FLG = hasSymbols();\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.toStringTag` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.toStringTag` support\n*\n* @example\n* var bool = hasToStringTagSupport();\n* // returns \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) 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 valueOf = String.prototype.valueOf; // non-generic\n\n\n// EXPORTS //\n\nexport default valueOf;\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 test from './try2valueof.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string object\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns false\n*/\nfunction isString( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof String ) {\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 String]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport valueOf from './valueof.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to extract a string value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a string can be extracted\n*/\nfunction test( value ) {\n\ttry {\n\t\tvalueOf.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 string.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a string\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*/\nfunction isString( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether an input value is the string representing column-major order.\n*\n* @param {*} v - value to test\n* @returns {boolean} boolean result\n*\n* @example\n* var bool = isColumnMajorString( 'column-major' );\n* // returns true\n*\n* bool = isColumnMajorString( 'row-major' );\n* // returns false\n*\n* bool = isColumnMajorString( 'foo' );\n* // returns false\n*/\nfunction isColumnMajorString( v ) {\n\treturn ( v === 'column-major' );\n}\n\n\n// EXPORTS //\n\nexport default isColumnMajorString;\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 isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a stride array from an array shape (row-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} array strides\n*/\nfunction rowmajor( shape ) {\n\tvar ndims;\n\tvar out;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tout = [];\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tout.push( 0 );\n\t}\n\ts = 1;\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n/**\n* Generates a stride array from an array shape (column-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} array strides\n*/\nfunction columnmajor( shape ) {\n\tvar out;\n\tvar s;\n\tvar i;\n\n\tout = [];\n\ts = 1;\n\tfor ( i = 0; i < shape.length; i++ ) {\n\t\tout.push( s );\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates a stride array from an array shape.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @returns {Array} array strides\n*\n* @example\n* var s = shape2strides( [ 3, 2 ], 'row-major' );\n* // returns [ 2, 1 ]\n*\n* s = shape2strides( [ 3, 2 ], 'column-major' );\n* // returns [ 1, 3 ]\n*/\nfunction shape2strides( shape, order ) {\n\tif ( isColumnMajor( order ) ) {\n\t\treturn columnmajor( shape );\n\t}\n\treturn rowmajor( shape );\n}\n\n\n// EXPORTS //\n\nexport default shape2strides;\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 string.\n*\n* @module @stdlib/assert-is-string\n*\n* @example\n* import isString from '@stdlib/assert-is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 5 );\n* // returns false\n*\n* @example\n* import { isObject as isString } from '@stdlib/assert-is-string';\n*\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 'beep' );\n* // returns false\n*\n* @example\n* import { isPrimitive as isString } from '@stdlib/assert-is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns false\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* Generate a stride array from an array shape.\n*\n* @module @stdlib/ndarray-base-shape2strides\n*\n* @example\n* import shape2strides from '@stdlib/ndarray-base-shape2strides';\n*\n* var strides = shape2strides( [ 3, 2 ], 'row-major' );\n* // returns [ 2, 1 ]\n*\n* strides = shape2strides( [ 3, 2 ], 'column-major' );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a stride array from an array shape (row-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*/\nfunction rowmajor( shape, out ) {\n\tvar ndims;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\ts = 1;\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n/**\n* Generates a stride array from an array shape (column-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*/\nfunction columnmajor( shape, out ) {\n\tvar s;\n\tvar i;\n\n\ts = 1;\n\tfor ( i = 0; i < shape.length; i++ ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates a stride array from an array shape.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*\n* @example\n* var strides = [ 0, 0 ];\n*\n* var out = shape2strides( [ 3, 2 ], 'row-major', strides );\n* // returns [ 2, 1 ]\n*\n* var bool = ( out === strides );\n* // returns true\n*\n* out = shape2strides( [ 3, 2 ], 'column-major', strides );\n* // returns [ 1, 3 ]\n*/\nfunction shape2strides( shape, order, out ) {\n\tif ( isColumnMajor( order ) ) {\n\t\treturn columnmajor( shape, out );\n\t}\n\treturn rowmajor( shape, out );\n}\n\n\n// EXPORTS //\n\nexport default shape2strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isString } from '@stdlib/assert-is-string';\nimport shape2strides from '@stdlib/ndarray-base-shape2strides';\nimport copyIndexed from '@stdlib/array-base-copy-indexed';\n\n\n// VARIABLES //\n\nvar ROW_MAJOR = 'row-major';\n\n\n// MAIN //\n\n/**\n* Returns the strides of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @param {boolean} copy - boolean indicating whether to explicitly copy the value assigned to the input ndarray's `strides` property\n* @returns {IntegerArray} strides\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var out = strides( zeros( [ 3, 3, 3 ] ), false );\n* // returns [ 9, 3, 1 ]\n*/\nfunction strides( x, copy ) {\n\tvar ord;\n\tvar sh;\n\tvar st;\n\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\tsh = x.shape;\n\t\tif ( sh.length === 0 ) {\n\t\t\treturn [ 0 ];\n\t\t}\n\t\tord = x.order;\n\t\tif ( !isString( ord ) ) {\n\t\t\tord = ROW_MAJOR;\n\t\t}\n\t\treturn shape2strides( sh, ord );\n\t}\n\tif ( copy ) {\n\t\treturn copyIndexed( st );\n\t}\n\treturn st;\n}\n\n\n// EXPORTS //\n\nexport default strides;\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// 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) 2023 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 strides2offset from '@stdlib/ndarray-base-strides2offset';\n\n\n// MAIN //\n\n/**\n* Returns the index offset specifying the underlying buffer index of the first iterated ndarray element.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {NonNegativeInteger} index offset\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var n = offset( zeros( [ 3, 3, 3 ] ) );\n* // returns 0\n*/\nfunction offset( x ) {\n\tvar st;\n\tvar sh;\n\tvar o;\n\n\to = x.offset;\n\tif ( isNumber( o ) ) {\n\t\treturn o;\n\t}\n\tsh = x.shape;\n\tif ( sh.length === 0 ) {\n\t\treturn 0;\n\t}\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\treturn 0;\n\t}\n\treturn strides2offset( sh, st );\n}\n\n\n// EXPORTS //\n\nexport default offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a multidimensional array based on a stride array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var shape = [ 2, 3, 10 ];\n* var strides = [ 30, -10, 1 ];\n*\n* var offset = strides2offset( shape, strides );\n* // returns 20\n*/\nfunction strides2offset( shape, strides ) {\n\tvar offset;\n\tvar ndims;\n\tvar i;\n\n\tndims = shape.length;\n\toffset = 0;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( strides[ i ] < 0 ) {\n\t\t\t// Note that, since the stride is negative, this operation increments, not decrements, the offset...\n\t\t\toffset -= strides[ i ] * ( shape[ i ]-1 );\n\t\t}\n\t}\n\treturn offset;\n}\n\n\n// EXPORTS //\n\nexport default strides2offset;\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// MAIN //\n\n/**\n* Computes the absolute value of a double-precision floating-point number `x`.\n*\n* @param {number} x - input value\n* @returns {number} absolute value\n*\n* @example\n* var v = abs( -1.0 );\n* // returns 1.0\n*\n* @example\n* var v = abs( 2.0 );\n* // returns 2.0\n*\n* @example\n* var v = abs( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( -0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( NaN );\n* // returns NaN\n*/\nfunction abs( x ) {\n\treturn Math.abs( x ); // eslint-disable-line stdlib/no-builtin-math\n}\n\n\n// EXPORTS //\n\nexport default abs;\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 abs from '@stdlib/math-base-special-abs';\n\n\n// MAIN //\n\n/**\n* Determines the order of a multidimensional array based on a provided stride array.\n*\n* @param {IntegerArray} strides - stride array\n* @returns {integer} order\n*\n* @example\n* var order = strides2order( [ 2, 1 ] );\n* // returns 1\n*\n* order = strides2order( [ 1, 2 ] );\n* // returns 2\n*\n* order = strides2order( [ 1, 1, 1 ] );\n* // returns 3\n*\n* order = strides2order( [ 2, 3, 1 ] );\n* // returns 0\n*/\nfunction strides2order( strides ) {\n\tvar column;\n\tvar ndims;\n\tvar row;\n\tvar s1;\n\tvar s2;\n\tvar i;\n\n\tndims = strides.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0|0; // 'none'\n\t}\n\tcolumn = true;\n\trow = true;\n\n\ts1 = abs( strides[ 0 ] );\n\tfor ( i = 1; i < ndims; i++ ) {\n\t\ts2 = abs( strides[ i ] );\n\t\tif ( column && s2 < s1 ) {\n\t\t\tcolumn = false;\n\t\t} else if ( row && s2 > s1 ) {\n\t\t\trow = false;\n\t\t}\n\t\tif ( row || column ) {\n\t\t\ts1 = s2;\n\t\t} else {\n\t\t\treturn 0|0; // 'none'\n\t\t}\n\t}\n\tif ( row && column ) {\n\t\treturn 3|0; // 'both'\n\t}\n\tif ( row ) {\n\t\treturn 1|0; // 'row-major'\n\t}\n\treturn 2|0; // 'column-major'\n}\n\n\n// EXPORTS //\n\nexport default strides2order;\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) 2023 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 isString } from '@stdlib/assert-is-string';\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// VARIABLES //\n\nvar ROW_MAJOR = 'row-major';\nvar COLUMN_MAJOR = 'column-major';\n\n\n// MAIN //\n\n/**\n* Returns the layout order of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {(string|null)} layout order\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'order': 'row-major'\n* });\n*\n* var out = order( x );\n* // returns 'row-major'\n*/\nfunction order( x ) {\n\tvar st;\n\tvar o;\n\n\to = x.order;\n\tif ( isString( o ) ) {\n\t\treturn o;\n\t}\n\t// Try to infer the layout order from the strides array...\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\treturn ROW_MAJOR; // WARNING: default to row-major for ndarray-like objects lacking strides. This may or may not be accurate, and we're defaulting to row-major here based on the belief that row-major is more likely given that, e.g., JavaScript arrays are similar to C arrays (i.e., stored in row-major order).\n\t}\n\to = strides2order( st );\n\tif ( o === 1 || o === 3 ) {\n\t\treturn ROW_MAJOR; // for o == 3 (both row- and column-major; e.g., one-dimensional ndarrays), default to row-major\n\t}\n\tif ( o === 2 ) {\n\t\treturn COLUMN_MAJOR;\n\t}\n\t// o === 0\n\tif ( x.shape.length === 0 ) {\n\t\treturn ROW_MAJOR; // default to row-major for zero-dimensional ndarrays\n\t}\n\t// Case: mixed strides (e.g., [ 2, 3, 1 ] )\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default order;\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 isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport accessorSetter from '@stdlib/array-base-accessor-setter';\nimport getter from '@stdlib/array-base-getter';\nimport setter from '@stdlib/array-base-setter';\nimport numel from '@stdlib/ndarray-base-numel';\nimport getDType from '@stdlib/ndarray-base-dtype';\nimport getShape from '@stdlib/ndarray-base-shape';\nimport getStrides from '@stdlib/ndarray-base-strides';\nimport getOffset from '@stdlib/ndarray-base-offset';\nimport getOrder from '@stdlib/ndarray-base-order';\nimport getData from '@stdlib/ndarray-base-data-buffer';\n\n\n// MAIN //\n\n/**\n* Converts an ndarray-like object to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding ndarray meta data to ensure that internal functions operating on ndarrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **ref**: reference to the original ndarray-like object.\n* - **dtype**: underlying data type.\n* - **data**: data buffer.\n* - **length**: number of elements.\n* - **shape**: array dimensions.\n* - **strides**: array strides.\n* - **offset**: index offset.\n* - **order**: order.\n* - **accessorProtocol**: `boolean` indicating whether the data buffer supports the get/set protocol (i.e., uses accessors for getting and setting elements).\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an ndarray element and whose second element is an accessor for setting an ndarray element.\n*\n* @param {ndarrayLike} x - ndarray-like object\n* @param {*} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {Object} object containing ndarray meta data\n*\n* @example\n* import array from '@stdlib/ndarray-array';\n*\n* var x = array( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] );\n*\n* var obj = ndarraylike2object( x );\n* // returns {...}\n*/\nfunction ndarraylike2object( x ) {\n\tvar xbuf;\n\tvar bool;\n\tvar sh;\n\tvar dt;\n\n\txbuf = getData( x );\n\tsh = getShape( x, true );\n\tdt = getDType( x );\n\n\tbool = isAccessorArray( xbuf );\n\n\treturn {\n\t\t'ref': x,\n\t\t'dtype': dt,\n\t\t'data': xbuf,\n\t\t'length': numel( sh ),\n\t\t'shape': sh,\n\t\t'strides': getStrides( x, true ),\n\t\t'offset': getOffset( x ),\n\t\t'order': getOrder( x ),\n\t\t'accessorProtocol': bool,\n\t\t'accessors': ( bool ) ?\n\t\t\t[ accessorGetter( dt ), accessorSetter( dt ) ] :\n\t\t\t[ getter( dt ), setter( dt ) ]\n\t};\n}\n\n\n// EXPORTS //\n\nexport default ndarraylike2object;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the underlying data buffer of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {Collection} underlying data buffer\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'dtype': 'float64'\n* });\n*\n* var out = data( x );\n* // returns \n*/\nfunction data( x ) {\n\treturn x.data;\n}\n\n\n// EXPORTS //\n\nexport default data;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 copyIndexed from '@stdlib/array-base-copy-indexed';\n\n\n// MAIN //\n\n/**\n* Returns the shape of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @param {boolean} copy - boolean indicating whether to explicitly copy the value assigned to the input ndarray's `shape` property\n* @returns {NonNegativeIntegerArray} shape\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var out = shape( zeros( [ 3, 3, 3 ] ), false );\n* // returns [ 3, 3, 3 ]\n*/\nfunction shape( x, copy ) {\n\tvar sh = x.shape;\n\tif ( copy ) {\n\t\treturn copyIndexed( sh );\n\t}\n\treturn sh;\n}\n\n\n// EXPORTS //\n\nexport default shape;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the data type of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {string} data type\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'dtype': 'float64'\n* });\n*\n* var dt = dtype( x );\n* // returns 'float64'\n*/\nfunction dtype( x ) {\n\treturn x.dtype;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 16; // 8 bytes per float64 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isComplex128Array( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplex128Array( [] );\n* // returns false\n*/\nfunction isComplex128Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex128Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex128array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 8; // 4 bytes per float32 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var bool = isComplex64Array( new Complex64Array( 10 ) );\n* // returns true\n*\n* bool = isComplex64Array( [] );\n* // returns false\n*/\nfunction isComplex64Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex64Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex64array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex64Array;\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 hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float64Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float64Array\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat64Array( [] );\n* // returns false\n*/\nfunction isFloat64Array( value ) {\n\treturn (\n\t\t( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float64Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat64Array;\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 Float64Array === 'function' ) ? Float64Array : 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 Float64Array === 'function' ) ? Float64Array : 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/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float64\n*\n* @example\n* import ctor from '@stdlib/array-float64';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat64ArraySupport from '@stdlib/assert-has-float64array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\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 isFloat64Array from '@stdlib/assert-is-float64array';\nimport GlobalFloat64Array from './float64array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float64Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float64Array` support\n*\n* @example\n* var bool = hasFloat64ArraySupport();\n* // returns \n*/\nfunction hasFloat64ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat64Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );\n\t\tbool = (\n\t\t\tisFloat64Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.14 &&\n\t\t\tarr[ 2 ] === -3.14 &&\n\t\t\tarr[ 3 ] !== arr[ 3 ]\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 hasFloat64ArraySupport;\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 double-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) 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 Float64Array from '@stdlib/array-float64';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex128Array` as a `Float64Array`.\n*\n* @param {Complex128Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} `Float64Array` view\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\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/**\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 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) 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 Float32Array from '@stdlib/array-float32';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex64Array` as a `Float32Array`.\n*\n* @param {Complex64Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} `Float32Array` view\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\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 hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8Array\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8Array( [] );\n* // returns false\n*/\nfunction isUint8Array( value ) {\n\treturn (\n\t\t( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8Array;\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* Maximum unsigned 8-bit integer.\n*\n* @module @stdlib/constants-uint8-max\n* @type {integer32}\n*\n* @example\n* import UINT8_MAX from '@stdlib/constants-uint8-max';\n* // returns 255\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{8} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 255\n*/\nvar UINT8_MAX = 255|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default UINT8_MAX;\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 Uint8Array === 'function' ) ? Uint8Array : 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 Uint8Array === 'function' ) ? Uint8Array : 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/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint8\n*\n* @example\n* import ctor from '@stdlib/array-uint8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ArraySupport from '@stdlib/assert-has-uint8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\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 isUint8Array from '@stdlib/assert-is-uint8array';\nimport UINT8_MAX from '@stdlib/constants-uint8-max';\nimport GlobalUint8Array from './uint8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8Array` support\n*\n* @example\n* var bool = hasUint8ArraySupport();\n* // returns \n*/\nfunction hasUint8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];\n\t\tarr = new GlobalUint8Array( arr );\n\t\tbool = (\n\t\t\tisUint8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\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 hasUint8ArraySupport;\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 8-bit unsigned integers 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 nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar f;\n\n\n// FUNCTIONS //\n\n/**\n* Tests if a value is an array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an array\n*\n* @example\n* var bool = isArray( [] );\n* // returns true\n*\n* @example\n* var bool = isArray( {} );\n* // returns false\n*/\nfunction isArray( value ) {\n\treturn ( nativeClass( value ) === '[object Array]' );\n}\n\n\n// MAIN //\n\nif ( Array.isArray ) {\n\tf = Array.isArray;\n} else {\n\tf = isArray;\n}\n\n\n// EXPORTS //\n\nexport default f;\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 isArray from '@stdlib/assert-is-array';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array function\n*\n* @example\n* import isOdd from '@stdlib/assert-is-odd';\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arrayfcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArray( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default arrayfcn;\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 object-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is object-like\n*\n* @example\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( [] );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( null );\n* // returns false\n*/\nfunction isObjectLike( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObjectLike;\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 isObjectLike from '@stdlib/assert-is-object-like';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Buffer instance.\n*\n* @param {*} value - value to validate\n* @returns {boolean} boolean indicating if a value is a Buffer instance\n*\n* @example\n* var v = isBuffer( new Buffer( 'beep' ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( new Buffer( [1,2,3,4] ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( {} );\n* // returns false\n*\n* @example\n* var v = isBuffer( [] );\n* // returns false\n*/\nfunction isBuffer( value ) {\n\treturn (\n\t\tisObjectLike( value ) &&\n\t\t(\n\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\tvalue._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)\n\t\t\t(\n\t\t\t\tvalue.constructor &&\n\n\t\t\t\t// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions\n\t\t\t\ttypeof value.constructor.isBuffer === 'function' &&\n\t\t\t\tvalue.constructor.isBuffer( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBuffer;\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// MAIN //\n\n/**\n* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @returns {RegExp} regular expression\n*\n* @example\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\nfunction reFunctionName() {\n\treturn /^\\s*function\\s*([^(]*)/i;\n}\n\n\n// EXPORTS //\n\nexport default reFunctionName;\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 object-like.\n*\n* @module @stdlib/assert-is-object-like\n*\n* @example\n* import isObjectLike from '@stdlib/assert-is-object-like';\n*\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* bool = isObjectLike( [] );\n* // returns true\n*\n* bool = isObjectLike( null );\n* // returns false\n*\n* @example\n* import { isObjectLikeArray as isObjectLike } from '@stdlib/assert-is-object-like';\n*\n* var bool = isObjectLike( [ {}, [] ] );\n* // returns true\n*\n* bool = isObjectLike( [ {}, '3.0' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport arrayfun from '@stdlib/assert-tools-array-function';\nimport main from './main.js';\n\n\n// VARIABLES //\n\nvar isObjectLikeArray = arrayfun( main );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isObjectLikeArray', isObjectLikeArray );\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 reFunctionName from './main.js';\n\n\n// MAIN //\n\n/**\n* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* Regular expression: `/^\\s*function\\s*([^(]*)/i`\n*\n* - `/^\\s*`\n* - Match zero or more spaces at beginning\n*\n* - `function`\n* - Match the word `function`\n*\n* - `\\s*`\n* - Match zero or more spaces after the word `function`\n*\n* - `()`\n* - Capture\n*\n* - `[^(]*`\n* - Match anything except a left parenthesis `(` zero or more times\n*\n* - `/i`\n* - ignore case\n*\n* @constant\n* @type {RegExp}\n* @default /^\\s*function\\s*([^(]*)/i\n*/\nvar RE_FUNCTION_NAME = reFunctionName();\n\n\n// EXPORTS //\n\nexport default RE_FUNCTION_NAME;\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';\nimport { REGEXP as RE } from '@stdlib/regexp-function-name';\nimport isBuffer from '@stdlib/assert-is-buffer';\n\n\n// MAIN //\n\n/**\n* Determines the name of a value's constructor.\n*\n* @param {*} v - input value\n* @returns {string} name of a value's constructor\n*\n* @example\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* @example\n* var v = constructorName( 5 );\n* // returns 'Number'\n*\n* @example\n* var v = constructorName( null );\n* // returns 'Null'\n*\n* @example\n* var v = constructorName( undefined );\n* // returns 'Undefined'\n*\n* @example\n* var v = constructorName( function noop() {} );\n* // returns 'Function'\n*/\nfunction constructorName( v ) {\n\tvar match;\n\tvar name;\n\tvar ctor;\n\tname = nativeClass( v ).slice( 8, -1 );\n\tif ( (name === 'Object' || name === 'Error') && v.constructor ) {\n\t\tctor = v.constructor;\n\t\tif ( typeof ctor.name === 'string' ) {\n\t\t\treturn ctor.name;\n\t\t}\n\t\tmatch = RE.exec( ctor.toString() );\n\t\tif ( match ) {\n\t\t\treturn match[ 1 ];\n\t\t}\n\t}\n\tif ( isBuffer( v ) ) {\n\t\treturn 'Buffer';\n\t}\n\treturn name;\n}\n\n\n// EXPORTS //\n\nexport default constructorName;\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/**\n* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @module @stdlib/regexp-function-name\n*\n* @example\n* import reFunctionName from '@stdlib/regexp-function-name';\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport REGEXP from './regexp.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'REGEXP', REGEXP );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128',\n\t'BooleanArray': 'bool'\n};\n\n\n// EXPORTS //\n\nexport default ctor2dtypes;\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 hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint32Array\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint32Array( [] );\n* // returns false\n*/\nfunction isUint32Array( value ) {\n\treturn (\n\t\t( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint32Array;\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* Maximum unsigned 32-bit integer.\n*\n* @module @stdlib/constants-uint32-max\n* @type {uinteger32}\n*\n* @example\n* import UINT32_MAX from '@stdlib/constants-uint32-max';\n* // returns 4294967295\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar UINT32_MAX = 4294967295;\n\n\n// EXPORTS //\n\nexport default UINT32_MAX;\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 Uint32Array === 'function' ) ? Uint32Array : 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 Uint32Array === 'function' ) ? Uint32Array : 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/**\n* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint32\n*\n* @example\n* import ctor from '@stdlib/array-uint32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint32ArraySupport from '@stdlib/assert-has-uint32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\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 isUint32Array from '@stdlib/assert-is-uint32array';\nimport UINT32_MAX from '@stdlib/constants-uint32-max';\nimport GlobalUint32Array from './uint32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint32Array` support\n*\n* @example\n* var bool = hasUint32ArraySupport();\n* // returns \n*/\nfunction hasUint32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];\n\t\tarr = new GlobalUint32Array( arr );\n\t\tbool = (\n\t\t\tisUint32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\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 hasUint32ArraySupport;\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 32-bit unsigned integers 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 nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int32Array\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var bool = isInt32Array( new Int32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt32Array( [] );\n* // returns false\n*/\nfunction isInt32Array( value ) {\n\treturn (\n\t\t( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt32Array;\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* Maximum signed 32-bit integer.\n*\n* @module @stdlib/constants-int32-max\n* @type {integer32}\n*\n* @example\n* import INT32_MAX from '@stdlib/constants-int32-max';\n* // returns 2147483647\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{31} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 2147483647\n*/\nvar INT32_MAX = 2147483647|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MAX;\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 Int32Array === 'function' ) ? Int32Array : 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 Int32Array === 'function' ) ? Int32Array : 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/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int32\n*\n* @example\n* import ctor from '@stdlib/array-int32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt32ArraySupport from '@stdlib/assert-has-int32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt32ArraySupport() ) {\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 isInt32Array from '@stdlib/assert-is-int32array';\nimport INT32_MAX from '@stdlib/constants-int32-max';\nimport INT32_MIN from '@stdlib/constants-int32-min';\nimport GlobalInt32Array from './int32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int32Array` support\n*\n* @example\n* var bool = hasInt32ArraySupport();\n* // returns \n*/\nfunction hasInt32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT32_MIN // wrap around\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 hasInt32ArraySupport;\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* Minimum signed 32-bit integer.\n*\n* @module @stdlib/constants-int32-min\n* @type {integer32}\n*\n* @example\n* import INT32_MIN from '@stdlib/constants-int32-min';\n* // returns -2147483648\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{31})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -2147483648\n*/\nvar INT32_MIN = -2147483648|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MIN;\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 twos-complement 32-bit signed integers 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 nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint16Array\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint16Array( [] );\n* // returns false\n*/\nfunction isUint16Array( value ) {\n\treturn (\n\t\t( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint16Array;\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* Maximum unsigned 16-bit integer.\n*\n* @module @stdlib/constants-uint16-max\n* @type {integer32}\n*\n* @example\n* import UINT16_MAX from '@stdlib/constants-uint16-max';\n* // returns 65535\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{16} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 1111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 65535\n*/\nvar UINT16_MAX = 65535|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default UINT16_MAX;\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 Uint16Array === 'function' ) ? Uint16Array : 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 Uint16Array === 'function' ) ? Uint16Array : 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/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint16\n*\n* @example\n* import ctor from '@stdlib/array-uint16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint16ArraySupport from '@stdlib/assert-has-uint16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\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 isUint16Array from '@stdlib/assert-is-uint16array';\nimport UINT16_MAX from '@stdlib/constants-uint16-max';\nimport GlobalUint16Array from './uint16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint16Array` support\n*\n* @example\n* var bool = hasUint16ArraySupport();\n* // returns \n*/\nfunction hasUint16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];\n\t\tarr = new GlobalUint16Array( arr );\n\t\tbool = (\n\t\t\tisUint16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\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 hasUint16ArraySupport;\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 16-bit unsigned integers 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 nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int16Array\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var bool = isInt16Array( new Int16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt16Array( [] );\n* // returns false\n*/\nfunction isInt16Array( value ) {\n\treturn (\n\t\t( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt16Array;\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* Maximum signed 16-bit integer.\n*\n* @module @stdlib/constants-int16-max\n* @type {integer32}\n*\n* @example\n* import INT16_MAX from '@stdlib/constants-int16-max';\n* // returns 32767\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{15} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 32767\n*/\nvar INT16_MAX = 32767|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MAX;\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 Int16Array === 'function' ) ? Int16Array : 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 Int16Array === 'function' ) ? Int16Array : 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/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int16\n*\n* @example\n* import ctor from '@stdlib/array-int16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt16ArraySupport from '@stdlib/assert-has-int16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt16ArraySupport() ) {\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 isInt16Array from '@stdlib/assert-is-int16array';\nimport INT16_MAX from '@stdlib/constants-int16-max';\nimport INT16_MIN from '@stdlib/constants-int16-min';\nimport GlobalInt16Array from './int16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int16Array` support\n*\n* @example\n* var bool = hasInt16ArraySupport();\n* // returns \n*/\nfunction hasInt16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT16_MIN // wrap around\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 hasInt16ArraySupport;\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* Minimum signed 16-bit integer.\n*\n* @module @stdlib/constants-int16-min\n* @type {integer32}\n*\n* @example\n* import INT16_MIN from '@stdlib/constants-int16-min';\n* // returns -32768\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{15})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 1000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -32768\n*/\nvar INT16_MIN = -32768|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MIN;\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 twos-complement 16-bit signed integers 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 nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8ClampedArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8ClampedArray( [] );\n* // returns false\n*/\nfunction isUint8ClampedArray( value ) {\n\treturn (\n\t\t( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8ClampedArray]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8ClampedArray;\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 Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : 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 Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : 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/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @module @stdlib/array-uint8c\n*\n* @example\n* import ctor from '@stdlib/array-uint8c';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ClampedArraySupport from '@stdlib/assert-has-uint8clampedarray-support'; // eslint-disable-line id-length\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ClampedArraySupport() ) {\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 isUint8ClampedArray from '@stdlib/assert-is-uint8clampedarray';\nimport GlobalUint8ClampedArray from './uint8clampedarray.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8ClampedArray` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support\n*\n* @example\n* var bool = hasUint8ClampedArraySupport();\n* // returns \n*/\nfunction hasUint8ClampedArraySupport() { // eslint-disable-line id-length\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8ClampedArray !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );\n\t\tbool = (\n\t\t\tisUint8ClampedArray( arr ) &&\n\t\t\tarr[ 0 ] === 0 && // clamped\n\t\t\tarr[ 1 ] === 0 &&\n\t\t\tarr[ 2 ] === 1 &&\n\t\t\tarr[ 3 ] === 3 && // round to nearest\n\t\t\tarr[ 4 ] === 5 && // round to nearest\n\t\t\tarr[ 5 ] === 255 &&\n\t\t\tarr[ 6 ] === 255 // clamped\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 hasUint8ClampedArraySupport;\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 8-bit unsigned integers in the platform byte order clamped to 0-255.\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 nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int8Array\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var bool = isInt8Array( new Int8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt8Array( [] );\n* // returns false\n*/\nfunction isInt8Array( value ) {\n\treturn (\n\t\t( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt8Array;\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* Maximum signed 8-bit integer.\n*\n* @module @stdlib/constants-int8-max\n* @type {integer32}\n*\n* @example\n* import INT8_MAX from '@stdlib/constants-int8-max';\n* // returns 127\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* 2^{7} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 127\n*/\nvar INT8_MAX = 127|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MAX;\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 Int8Array === 'function' ) ? Int8Array : 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 Int8Array === 'function' ) ? Int8Array : 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/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int8\n*\n* @example\n* import ctor from '@stdlib/array-int8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt8ArraySupport from '@stdlib/assert-has-int8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt8ArraySupport() ) {\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 isInt8Array from '@stdlib/assert-is-int8array';\nimport INT8_MAX from '@stdlib/constants-int8-max';\nimport INT8_MIN from '@stdlib/constants-int8-min';\nimport GlobalInt8Array from './int8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int8Array` support\n*\n* @example\n* var bool = hasInt8ArraySupport();\n* // returns \n*/\nfunction hasInt8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT8_MIN // wrap around\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 hasInt8ArraySupport;\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* Minimum signed 8-bit integer.\n*\n* @module @stdlib/constants-int8-min\n* @type {integer32}\n*\n* @example\n* import INT8_MIN from '@stdlib/constants-int8-min';\n* // returns -128\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* -(2^{7})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -128\n*/\nvar INT8_MIN = -128|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MIN;\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 twos-complement 8-bit signed integers 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/**\n* Double-precision floating-point negative infinity.\n*\n* @module @stdlib/constants-float64-ninf\n* @type {number}\n*\n* @example\n* import FLOAT64_NINF from '@stdlib/constants-float64-ninf';\n* // returns -Infinity\n*/\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point negative infinity has the bit sequence\n*\n* ```binarystring\n* 1 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.NEGATIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_NINF = Number.NEGATIVE_INFINITY;\n\n\n// EXPORTS //\n\nexport default FLOAT64_NINF;\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: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward negative infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* @example\n* var v = floor( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = floor( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = floor( NaN );\n* // returns NaN\n*/\nvar floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default floor;\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 floor from '@stdlib/math-base-special-floor';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an integer\n*\n* @example\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( 3.14 );\n* // returns false\n*/\nfunction isInteger( x ) {\n\treturn (floor(x) === x);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport isInt from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a number primitive is an integer value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a number primitive is an integer value\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tvalue < PINF &&\n\t\tvalue > NINF &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having an integer value\n*\n* @example\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having an integer value\n*\n* @example\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 an integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an integer\n*\n* @example\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isInteger( -3.14 );\n* // returns false\n*\n* @example\n* var bool = isInteger( null );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\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 isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\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 { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\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 nonnegative integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( null );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\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 an integer.\n*\n* @module @stdlib/assert-is-integer\n*\n* @example\n* import isInteger from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isInteger( -3.14 );\n* // returns false\n*\n* bool = isInteger( null );\n* // returns false\n*\n* @example\n* // Use interface to check for integer primitives...\n* import { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*\n* @example\n* // Use interface to check for integer objects...\n* import { isObject as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* bool = isInteger( new Number( 3.0 ) );\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* Test if a value is a nonnegative integer.\n*\n* @module @stdlib/assert-is-nonnegative-integer\n*\n* @example\n* import isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* bool = isNonNegativeInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\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* Maximum length of a generic array.\n*\n* @module @stdlib/constants-array-max-array-length\n*\n* @example\n* import MAX_ARRAY_LENGTH from '@stdlib/constants-array-max-array-length';\n* // returns 4294967295\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a generic array.\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default MAX_ARRAY_LENGTH;\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 isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is an array-like object\n*\n* @example\n* var bool = isArrayLikeObject( [] );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( { 'length': 10 } );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( 'beep' );\n* // returns false\n*/\nfunction isArrayLikeObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayLikeObject;\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* Maximum length of a typed array.\n*\n* @module @stdlib/constants-array-max-typed-array-length\n*\n* @example\n* import MAX_TYPED_ARRAY_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n* // returns 9007199254740991\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a typed array.\n*\n* ```tex\n* 2^{53} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 9007199254740991\n*/\nvar MAX_TYPED_ARRAY_LENGTH = 9007199254740991;\n\n\n// EXPORTS //\n\nexport default MAX_TYPED_ARRAY_LENGTH;\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 isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a collection.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a collection\n*\n* @example\n* var bool = isCollection( [] );\n* // returns true\n*\n* @example\n* var bool = isCollection( {} );\n* // returns false\n*/\nfunction isCollection( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isCollection;\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 hasArrayBuffer = ( typeof ArrayBuffer === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an ArrayBuffer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an ArrayBuffer\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isArrayBuffer( [] );\n* // returns false\n*/\nfunction isArrayBuffer( value ) {\n\treturn (\n\t\t( hasArrayBuffer && value instanceof ArrayBuffer ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object ArrayBuffer]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayBuffer;\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 isArray from '@stdlib/assert-is-array';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an object; e.g., `{}`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an object\n*\n* @example\n* var bool = isObject( {} );\n* // returns true\n*\n* @example\n* var bool = isObject( null );\n* // returns false\n*/\nfunction isObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t!isArray( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObject;\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 an array of strings.\n*\n* @module @stdlib/assert-is-string-array\n*\n* @example\n* import isStringArray from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', 123 ] );\n* // returns false\n*\n* @example\n* import { primitives as isStringArray } from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', new String( 'def' ) ] );\n* // returns false\n*\n* @example\n* import { objects as isStringArray } from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );\n* // returns true\n*\n* bool = isStringArray( [ new String( 'abc' ), 'def' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport arrayfun from '@stdlib/assert-tools-array-function';\nimport isString from '@stdlib/assert-is-string';\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isString.isPrimitive );\nvar isObjectArray = arrayfun( isString.isObject );\n\n\n// MAIN //\n\nvar isStringArray = arrayfun( isString );\nsetReadOnly( isStringArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isStringArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nexport default isStringArray;\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\nvar RE = /./;\n\n\n// EXPORTS //\n\nexport default RE;\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) 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* 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// MAIN //\n\nvar obj = ( typeof self === 'object' ) ? self : null;\n\n\n// EXPORTS //\n\nexport default obj;\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 obj = ( typeof window === 'object' ) ? window : null;\n\n\n// EXPORTS //\n\nexport default obj;\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 obj = ( typeof global === 'object' ) ? global : null;\n\n\n// EXPORTS //\n\nexport default obj;\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\nvar obj = ( typeof globalThis === 'object' ) ? globalThis : null; // eslint-disable-line no-undef\n\n\n// EXPORTS //\n\nexport default obj;\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 getGlobal from '@stdlib/utils-global';\n\n\n// MAIN //\n\nvar root = getGlobal();\nvar nodeList = root.document && root.document.childNodes;\n\n\n// EXPORTS //\n\nexport default nodeList;\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 isBoolean } from '@stdlib/assert-is-boolean';\nimport format from '@stdlib/string-format';\nimport getThis from './codegen.js';\nimport Self from './self.js';\nimport Win from './window.js';\nimport Global from './global.js';\nimport GlobalThis from './global_this.js';\n\n\n// MAIN //\n\n/**\n* Returns the global object.\n*\n* ## Notes\n*\n* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.\n*\n* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object\n* @throws {TypeError} must provide a boolean\n* @throws {Error} unable to resolve global object\n* @returns {Object} global object\n*\n* @example\n* var g = getGlobal();\n* // returns {...}\n*/\nfunction getGlobal( codegen ) {\n\tif ( arguments.length ) {\n\t\tif ( !isBoolean( codegen ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a boolean. Value: `%s`.', codegen ) );\n\t\t}\n\t\tif ( codegen ) {\n\t\t\treturn getThis();\n\t\t}\n\t\t// Fall through...\n\t}\n\t// Case: 2020 revision of ECMAScript standard\n\tif ( GlobalThis ) {\n\t\treturn GlobalThis;\n\t}\n\t// Case: browsers and web workers\n\tif ( Self ) {\n\t\treturn Self;\n\t}\n\t// Case: browsers\n\tif ( Win ) {\n\t\treturn Win;\n\t}\n\t// Case: Node.js\n\tif ( Global ) {\n\t\treturn Global;\n\t}\n\t// Case: unknown\n\tthrow new Error( 'unexpected error. Unable to resolve global object.' );\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the global object using code generation.\n*\n* @private\n* @returns {Object} global object\n*/\nfunction getGlobal() {\n\treturn new Function( 'return this;' )(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\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\nvar typedarray = Int8Array; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default typedarray;\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* Determine a value's type.\n*\n* @module @stdlib/utils-type-of\n*\n* @example\n* import typeOf from '@stdlib/utils-type-of';\n*\n* var str = typeOf( 'a' );\n* // returns 'string'\n*\n* str = typeOf( 5 );\n* // returns 'number'\n*/\n\n// MODULES //\n\nimport usePolyfill from './check.js';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main = ( usePolyfill() ) ? polyfill : builtin;\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 RE from './fixtures/re.js';\nimport nodeList from './fixtures/nodelist.js';\nimport typedarray from './fixtures/typedarray.js';\n\n\n// MAIN //\n\n/**\n* Checks whether a polyfill is needed when using the `typeof` operator.\n*\n* @private\n* @returns {boolean} boolean indicating whether a polyfill is needed\n*/\nfunction check() {\n\tif (\n\t\t// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):\n\t\ttypeof RE === 'function' ||\n\n\t\t// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):\n\t\ttypeof typedarray === 'object' ||\n\n\t\t// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):\n\t\ttypeof nodeList === 'function'\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default check;\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 ctorName from '@stdlib/utils-constructor-name';\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\treturn ctorName( v ).toLowerCase();\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\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 ctorName from '@stdlib/utils-constructor-name';\n\n\n// NOTES //\n\n/*\n* Built-in `typeof` operator behavior:\n*\n* ```text\n* typeof null => 'object'\n* typeof undefined => 'undefined'\n* typeof 'a' => 'string'\n* typeof 5 => 'number'\n* typeof NaN => 'number'\n* typeof true => 'boolean'\n* typeof false => 'boolean'\n* typeof {} => 'object'\n* typeof [] => 'object'\n* typeof function foo(){} => 'function'\n* typeof function* foo(){} => 'object'\n* typeof Symbol() => 'symbol'\n* ```\n*\n*/\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\tvar type;\n\n\t// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):\n\tif ( v === null ) {\n\t\treturn 'null';\n\t}\n\ttype = typeof v;\n\n\t// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.\n\tif ( type === 'object' ) {\n\t\treturn ctorName( v ).toLowerCase();\n\t}\n\treturn type;\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\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 typeOf from '@stdlib/utils-type-of';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a function.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a function\n*\n* @example\n* function beep() {\n* return 'beep';\n* }\n*\n* var bool = isFunction( beep );\n* // returns true\n*/\nfunction isFunction( value ) {\n\t// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.\n\treturn ( typeOf( value ) === 'function' );\n}\n\n\n// EXPORTS //\n\nexport default isFunction;\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* 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// 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 \n*/\nfunction Complex64( real, imag ) {\n\tif ( !( this instanceof Complex64 ) ) {\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', float64ToFloat32( real ) );\n\tsetEnumerableReadOnly( this, 'im', float64ToFloat32( imag ) );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64\n* @readonly\n* @type {string}\n* @default 'Complex64'\n*\n* @example\n* var name = Complex64.name;\n* // returns 'Complex64'\n*/\nsetReadOnly( Complex64, 'name', 'Complex64' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex64.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64.prototype, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 8\n*/\nsetReadOnly( Complex64.prototype, 'byteLength', 8 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex64.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 `Complex64` instance.\n*\n* @name toJSON\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex64.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex64;\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 Complex128 from '@stdlib/complex-float64-ctor';\nimport Complex64 from '@stdlib/complex-float32-ctor';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex number-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex number-like object.\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var x = new Complex128( 4.0, 2.0 );\n* var bool = isComplexLike( x );\n* // returns true\n*\n* x = new Complex64( 4.0, 2.0 );\n* bool = isComplexLike( x );\n* // returns true\n*/\nfunction isComplexLike( value ) {\n\tif ( value instanceof Complex128 || value instanceof Complex64 ) {\n\t\treturn true;\n\t}\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.re === 'number' &&\n\t\ttypeof value.im === 'number'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplexLike;\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 isInteger from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a finite numeric value is an even number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an even number\n*\n* @example\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isEven( -2.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( NaN );\n* // returns false\n*/\nfunction isEven( x ) {\n\treturn isInteger( x/2.0 );\n}\n\n\n// EXPORTS //\n\nexport default isEven;\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 Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.iterator` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.iterator` support\n*\n* @example\n* var bool = hasIteratorSymbolSupport();\n* // returns \n*/\nfunction hasIteratorSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol' &&\n\t\thasOwnProp( Symbol, 'iterator' ) &&\n\t\ttypeof Symbol.iterator === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasIteratorSymbolSupport;\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 = 'Complex64';\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// MODULES //\n\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\n\n\n// MAIN //\n\n/**\n* Iterator symbol.\n*\n* @name IteratorSymbol\n* @constant\n* @type {(symbol|null)}\n*\n* @example\n* function iterator() {\n* var it;\n* var i;\n*\n* i = -1;\n*\n* it = {};\n* it.next = next;\n* it.return = done;\n*\n* if ( IteratorSymbol ) {\n* it[ IteratorSymbol ] = iterator;\n* }\n* return it;\n*\n* function next() {\n* i += 1;\n* return {\n* 'value': i,\n* 'done': false\n* };\n* }\n*\n* function done( value ) {\n* if ( arguments.length === 0 ) {\n* return {\n* 'done': true\n* };\n* }\n* return {\n* 'value': value,\n* 'done': true\n* };\n* }\n* }\n*\n* var obj = iterator();\n*/\nvar IteratorSymbol = ( hasIteratorSymbolSupport() ) ? Symbol.iterator : null;\n\n\n// EXPORTS //\n\nexport default IteratorSymbol;\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 accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnlyAccessor;\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/**\n* Returns the real component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\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/**\n* Returns the imaginary component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\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 isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\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 isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isArray from '@stdlib/assert-is-array';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport isFunction from '@stdlib/assert-is-function';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isEven from '@stdlib/math-base-assert-is-even';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Float32Array from '@stdlib/array-float32';\nimport Complex64 from '@stdlib/complex-float32-ctor';\nimport format from '@stdlib/string-format';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport floor from '@stdlib/math-base-special-floor';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float32Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex64} complex number\n*/\nfunction getComplex64( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); // FIXME: `buf` is what is returned from above, NOT the original value\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = realf( z );\n* // returns 9.0\n*\n* im = imagf( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, getComplex64( buf, i ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex64Array} modified array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.fill( new Complex64( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = realf( value );\n\tim = imagf( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex64Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex64Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 10 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n* // returns -1\n*/\nsetReadOnly( Complex64Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex64( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( v, i ) {\n* return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2\n*\n* var im = imagf( z );\n* // returns -2\n*/\nsetReadOnly( Complex64Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex64( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = realf( v );\n\t\t\toutbuf[ (2*i)+1 ] = imagf( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import caddf from '@stdlib/complex-float32-base-add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import caddf from '@stdlib/complex-float32-base-add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = realf( tmp[i] );\n\t\tbuf[ j+1 ] = imagf( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + (begin*BYTES_PER_ELEMENT);\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex64Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = realf( v );\n* // returns 1.0\n*\n* var im = imagf( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = realf( v );\n* // returns 2.0\n*\n* im = imagf( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex64( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex64Array} new typed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 4.0\n*\n* var im = imagf( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex64Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = realf( value );\n\tbuf[ (2*index)+1 ] = imagf( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex64Array;\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 isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\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* Returns the real component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\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* Returns the imaginary component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\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 isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport format from '@stdlib/string-format';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\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 isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isArray from '@stdlib/assert-is-array';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport isString from '@stdlib/assert-is-string';\nimport isFunction from '@stdlib/assert-is-function';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isEven from '@stdlib/math-base-assert-is-even';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Float64Array from '@stdlib/array-float64';\nimport Complex128 from '@stdlib/complex-float64-ctor';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\nimport floor from '@stdlib/math-base-special-floor';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport format from '@stdlib/string-format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float64Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex128} complex number\n*/\nfunction getComplex128( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = real( z );\n* // returns 9.0\n*\n* im = imag( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex128Array} modified array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.fill( new Complex128( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = real( value );\n\tim = imag( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex128Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex128Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex128( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex128( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex128( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex128( 4.0, -4.0 ), -3 );\n* // returns 3\n*/\nsetReadOnly( Complex128Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex128( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function scale( v, i ) {\n* return new Complex128( 2.0*real( v ), 2.0*imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns -2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex128( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = real( v );\n\t\t\toutbuf[ (2*i)+1 ] = imag( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import cadd from '@stdlib/complex-float64-base-add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import cadd from '@stdlib/complex-float64-base-add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = real( tmp[i] );\n\t\tbuf[ j+1 ] = imag( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex128Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = real( v );\n* // returns 1.0\n*\n* var im = imag( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = real( v );\n* // returns 2.0\n*\n* im = imag( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex128( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex128Array} new typed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex128( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 4.0\n*\n* var im = imag( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex128Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = real( value );\n\tbuf[ (2*index)+1 ] = imag( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex128Array;\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 isComplexLike from '@stdlib/assert-is-complex-like';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( Boolean( v.value ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\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 isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport format from '@stdlib/string-format';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isFunction from '@stdlib/assert-is-function';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Boolean from '@stdlib/boolean-ctor';\nimport getter from '@stdlib/array-base-getter';\nimport floor from '@stdlib/math-base-special-floor';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport format from '@stdlib/string-format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Uint8Array.BYTES_PER_ELEMENT;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a `BooleanArray`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `BooleanArray`\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'BooleanArray' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a boolean typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean typed array constructor\n*/\nfunction isBooleanArrayConstructor( value ) {\n\treturn ( value === BooleanArray );\n}\n\n\n// MAIN //\n\n/**\n* Boolean array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new BooleanArray( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new BooleanArray( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 16\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 8\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new BooleanArray( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction BooleanArray() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof BooleanArray) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new BooleanArray();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new BooleanArray( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new BooleanArray( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new BooleanArray( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Uint8Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ 0 ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new Uint8Array( arg.length ), arg );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( fromIterator( buf ) );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new Uint8Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var nbytes = BooleanArray.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof BooleanArray\n* @readonly\n* @type {string}\n* @default 'BooleanArray'\n*\n* @example\n* var str = BooleanArray.name;\n* // returns 'BooleanArray'\n*/\nsetReadOnly( BooleanArray, 'name', 'BooleanArray' );\n\n/**\n* Creates a new boolean array from an array-like object or an iterable.\n*\n* @name from\n* @memberof BooleanArray\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.from( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return !v;\n* }\n*\n* var arr = BooleanArray.from( [ true, false ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( BooleanArray, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf[ i ] = Boolean( clbk.call( thisArg, get( src, i ), i ) );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new boolean array from a variable number of arguments.\n*\n* @name of\n* @memberof BooleanArray\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.of( true, true, true, true );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( BooleanArray, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide an integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.at( 0 );\n* // returns true\n*\n* v = arr.at( -1 );\n* // returns true\n*\n* v = arr.at( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'at', function at( idx ) {\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tif ( idx < 0 ) {\n\t\tidx += len;\n\t}\n\tif ( idx < 0 || idx >= len ) {\n\t\treturn;\n\t}\n\treturn Boolean( buf[ idx ] );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray.prototype, 'BYTES_PER_ELEMENT', BooleanArray.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 4 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n* arr.set( true, 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* var v = arr.get( 2 );\n* // returns true\n*\n* v = arr.get( 3 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target, start );\n\t} else {\n\t\tthis._buffer.copyWithin( target, start, arguments[2] );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var it = arr.entries();\n*\n* var v = it.next().value;\n* // returns [ 0, true ]\n*\n* v = it.next().value;\n* // returns [ 1, false ]\n*\n* v = it.next().value;\n* // returns [ 2, true ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, Boolean( buf[ i ] ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.fill( true, 1 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar val;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tif ( value ) {\n\t\tval = 1;\n\t} else {\n\t\tval = 0;\n\t}\n\tfor ( i = start; i < end; i++ ) {\n\t\tbuf[ i ] = val;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* function predicate( v ) {\n* return ( v === true );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 2\n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\tout.push( v );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.find( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findIndex( predicate );\n* // returns 0\n*/\nsetReadOnly( BooleanArray.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLast( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLastIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( BooleanArray.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tfcn.call( thisArg, Boolean( buf[ i ] ), i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'get', function get( idx ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn Boolean( this._buffer[ idx ] );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a value\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var bool = arr.includes( true );\n* // returns true\n*\n* bool = arr.includes( false, 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.indexOf( true );\n* // returns 0\n*\n* idx = arr.indexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.indexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.join();\n* // returns 'true,false,true'\n*\n* str = arr.join( '|' );\n* // returns 'true|false|true'\n*/\nsetReadOnly( BooleanArray.prototype, 'join', function join( separator ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isString( separator ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t\t}\n\t} else {\n\t\tseparator = ',';\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( separator );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.lastIndexOf( true );\n* // returns 4\n*\n* idx = arr.lastIndexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} new boolean array\n*\n* @example\n* function invert( v ) {\n* return !v;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.map( invert );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns false\n*\n* z = out.get( 1 );\n* // returns true\n*\n* z = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be a function. Value: `%s`.', fcn );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\toutbuf[ i ] = Boolean( fcn.call( thisArg, Boolean( buf[ i ] ), i, this ) );\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduce( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ 0 ] );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduceRight( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len - 1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ len-1 ] );\n\t\ti = len - 2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ i ];\n\t\tbuf[ i ] = buf[ j ];\n\t\tbuf[ j ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(Collection|BooleanArray|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tif ( isBooleanArray( value ) ) {\n\t\t\tsbuf = value._buffer; // eslint-disable-line no-underscore-dangle\n\t\t} else {\n\t\t\tsbuf = value;\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Uint8Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf[ idx ] = ( sbuf[ i ] ) ? 1 : 0;\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf[ idx ] = ( value ) ? 1 : 0;\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be integer\n* @throws {TypeError} second argument must be integer\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var bool = out.get( 0 );\n* // returns true\n*\n* bool = out.get( len-1 );\n* // returns true\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* bool = out.get( 0 );\n* // returns false\n*\n* bool = out.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'slice', function slice( begin, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar len;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin < end ) {\n\t\toutlen = end - begin;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\toutbuf[ i ] = buf[ i+begin ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( false, 0 );\n* arr.set( true, 1 );\n* arr.set( false, 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.sort( compare );\n*\n* var v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'sort', function sort( compareFcn ) {\n\tvar buf;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length === 0 ) {\n\t\tbuf.sort();\n\t\treturn this;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf.sort( compare );\n\treturn this;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {BooleanArray} subarray\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var bool = subarr.get( 0 );\n* // returns true\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* bool = subarr.get( 0 );\n* // returns false\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toLocaleString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( Boolean( buf[ i ] ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ len - i - 1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*\n* v = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ i ];\n\t}\n\tif ( arguments.length === 0 ) {\n\t\toutbuf.sort();\n\t\treturn out;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\toutbuf.sort( compare );\n\treturn out;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns true\n*\n* v = iter.next().value;\n* // returns false\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': Boolean( buf[ i ] ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {boolean} value - new value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a boolean\n* @returns {BooleanArray} new typed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.with( 0, false );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tif ( value ) {\n\t\tbuf[ index ] = 1;\n\t} else {\n\t\tbuf[ index ] = 0;\n\t}\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default BooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Fills an output array with \"boolean\" values.\n*\n* @private\n* @param {Uint8Array} buf - output array\n* @param {Array} arr - input array\n* @returns {Uint8Array} output array\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar i;\n\n\tlen = arr.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tbuf[ i ] = Boolean( arr[ i ] );\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( Boolean( clbk.call( thisArg, v.value, i ) ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array-float64';\nimport Float32Array from '@stdlib/array-float32';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Int32Array from '@stdlib/array-int32';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Int16Array from '@stdlib/array-int16';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Int8Array from '@stdlib/array-int8';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array,\n\tBooleanArray\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128',\n\t'bool'\n];\n\n\n// EXPORTS //\n\nexport default DTYPES;\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 isBuffer from '@stdlib/assert-is-buffer';\nimport isArray from '@stdlib/assert-is-array';\nimport constructorName from '@stdlib/utils-constructor-name';\nimport ctor2dtype from './ctor2dtype.js';\nimport CTORS from './ctors.js';\nimport DTYPES from './dtypes.js';\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\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 isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport getter from '@stdlib/array-base-getter';\nimport setter from '@stdlib/array-base-setter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport accessorSetter from '@stdlib/array-base-accessor-setter';\nimport dtype from '@stdlib/array-dtype';\n\n\n// MAIN //\n\n/**\n* Converts an array-like to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding array meta data to ensure that internal functions operating on arrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **data**: reference to the input array.\n* - **dtype**: array data type.\n* - **accessorProtocol**: `boolean` indicating whether the input array uses accessors for getting and setting elements.\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.\n*\n* @param {Collection} x - array-like object\n* @returns {Object} object containing array meta data\n*\n* @example\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\nfunction arraylike2object( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn {\n\t\t\t'data': x,\n\t\t\t'dtype': dt,\n\t\t\t'accessorProtocol': true,\n\t\t\t'accessors': [\n\t\t\t\taccessorGetter( dt ),\n\t\t\t\taccessorSetter( dt )\n\t\t\t]\n\t\t};\n\t}\n\treturn {\n\t\t'data': x,\n\t\t'dtype': dt,\n\t\t'accessorProtocol': false,\n\t\t'accessors': [\n\t\t\tgetter( dt ),\n\t\t\tsetter( dt )\n\t\t]\n\t};\n}\n\n\n// EXPORTS //\n\nexport default arraylike2object;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies `x` by a scalar `alpha`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} stride - index increment\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n*\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gscal( 3, 5.0, arraylike2object( toAccessorArray( x ) ), 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction gscal( N, alpha, x, stride, offset ) {\n\tvar xbuf;\n\tvar xget;\n\tvar xset;\n\tvar ix;\n\tvar m;\n\tvar i;\n\n\txbuf = x.data;\n\txget = x.accessors[ 0 ];\n\txset = x.accessors[ 1 ];\n\n\tix = offset;\n\tif ( stride === 0 ) {\n\t\txset( xbuf, ix, xget( xbuf, ix ) * N * alpha );\n\t\treturn x;\n\t}\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\txset( xbuf, ix, xget( xbuf, ix ) * alpha );\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\txset( xbuf, ix, xget( xbuf, ix ) * alpha );\n\t\t\txset( xbuf, ix+1, xget( xbuf, ix+1 ) * alpha );\n\t\t\txset( xbuf, ix+2, xget( xbuf, ix+2 ) * alpha );\n\t\t\txset( xbuf, ix+3, xget( xbuf, ix+3 ) * alpha );\n\t\t\txset( xbuf, ix+4, xget( xbuf, ix+4 ) * alpha );\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\txset( xbuf, ix, xget( xbuf, ix ) * alpha );\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gscal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 5;\n\n\n// MAIN //\n\n/**\n* Multiplies a vector by a scalar constant using alternative indexing semantics.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar\n* @param {NumericArray} x - input array\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gscal( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, -20.0, 25.0, -30.0 ]\n*/\nfunction gscal( N, alpha, x, stride, offset ) {\n\tvar ix;\n\tvar m;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 || alpha === 1.0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, alpha, o, stride, offset );\n\t\treturn x;\n\t}\n\n\tix = offset;\n\tif ( stride === 0 ) {\n\t\tx[ ix ] *= alpha * N;\n\t\treturn x;\n\t}\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( stride === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] *= alpha;\n\t\t\t\tix += stride;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] *= alpha;\n\t\t\tx[ ix+1 ] *= alpha;\n\t\t\tx[ ix+2 ] *= alpha;\n\t\t\tx[ ix+3 ] *= alpha;\n\t\t\tx[ ix+4 ] *= alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] *= alpha;\n\t\tix += stride;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gscal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 stride2offset from '@stdlib/strided-base-stride2offset';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\n/**\n* Multiplies a vector by a scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {number} alpha - scalar constant\n* @param {NumericArray} x - input array\n* @param {PositiveInteger} stride - stride length\n* @returns {NumericArray} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\nfunction gscal( N, alpha, x, stride ) {\n\treturn ndarray( N, alpha, x, stride, stride2offset( N, stride ) );\n}\n\n\n// EXPORTS //\n\nexport default gscal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a strided array.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {integer} stride - index increment\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var offset = stride2offset( 10, -10 );\n* // returns 90\n*/\nfunction stride2offset( N, stride ) {\n\tif ( stride > 0 ) {\n\t\treturn 0;\n\t}\n\treturn ( 1 - N ) * stride;\n}\n\n\n// EXPORTS //\n\nexport default stride2offset;\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* Generates a linearly spaced numeric array whose elements increment by 1 starting from zero.\n*\n* @param {number} n - number of elements\n* @returns {Array} linearly spaced numeric array\n*\n* @example\n* var arr = zeroTo( 6 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*/\nfunction zeroTo( n ) {\n\tvar arr;\n\tvar i;\n\n\tarr = [];\n\tif ( n <= 0 ) {\n\t\treturn arr;\n\t}\n\tfor ( i = 0; i < n; i++ ) {\n\t\tarr.push( i );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nexport default zeroTo;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\n\n\n// FUNCTIONS //\n\n/**\n* Fills an indexed array with linearly spaced numeric elements which increment by 1 starting from zero.\n*\n* @private\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* var arr = indexed( out, 1, 0 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*\n* @example\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* var arr = indexed( out, -1, out.length-1 );\n* // returns [ 5, 4, 3, 2, 1, 0 ]\n*/\nfunction indexed( out, stride, offset ) {\n\tvar v;\n\tvar i;\n\n\ti = offset;\n\tv = 0;\n\twhile ( i >= 0 && i < out.length ) {\n\t\tout[ i ] = v;\n\t\ti += stride;\n\t\tv += 1;\n\t}\n\treturn out;\n}\n\n/**\n* Fills a complex number array with linearly spaced numeric elements which increment by 1 starting from zero.\n*\n* @private\n* @param {(Complex128Array|Complex64Array)} out - output complex number array\n* @param {(Float64Array|Float32Array)} data - output array data\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {(Complex128Array|Complex64Array)} output array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n* import reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\n*\n* var out = new Complex128Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );\n* // returns \n*\n* var data = reinterpret128( out, 0 );\n* // returns [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]\n*\n* var arr = complex( out, data, 1, 0 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*\n* data = reinterpret128( out, 0 );\n* returns [ 0.0, 0.0, 1.0, 0.0, 2.0, 0.0 ]\n*/\nfunction complex( out, data, stride, offset ) {\n\tvar v;\n\tvar s;\n\tvar i;\n\n\ts = stride * 2;\n\ti = offset * 2;\n\tv = 0.0;\n\twhile ( i >= 0 && i < data.length ) {\n\t\tdata[ i ] = v; // real component\n\t\tdata[ i+1 ] = 0.0; // imaginary component\n\t\ti += s;\n\t\tv += 1.0;\n\t}\n\treturn out;\n}\n\n/**\n* Fills an accessor array with linearly spaced numeric elements which increment by 1 starting from zero.\n*\n* @private\n* @param {Object} out - output array object\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n\n* var out = toAccessorArray( [ 0, 0, 0, 0, 0, 0 ] );\n* var arr = accessors( arraylike2object( out ), 1, 0 );\n*\n* var bool = ( arr === out );\n* // returns true\n*\n* var v = out.get( 0 );\n* // returns 0\n*\n* v = out.get( out.length-1 );\n* // returns 5\n*/\nfunction accessors( out, stride, offset ) {\n\tvar data;\n\tvar set;\n\tvar v;\n\tvar i;\n\n\tdata = out.data;\n\tset = out.accessors[ 1 ];\n\n\ti = offset;\n\tv = 0;\n\twhile ( i >= 0 && i < data.length ) {\n\t\tset( data, i, v );\n\t\ti += stride;\n\t\tv += 1;\n\t}\n\treturn data;\n}\n\n\n// MAIN //\n\n/**\n* Fills an array with linearly spaced numeric elements which increment by 1 starting from zero.\n*\n* @param {Collection} out - output array\n* @param {integer} stride - output array stride\n* @param {NonNegativeInteger} offset - output array index offset\n* @returns {Collection} output array\n*\n* @example\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* var arr = assign( out, 1, 0 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*\n* @example\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n*\n* var arr = assign( out, -1, out.length-1 );\n* // returns [ 5, 4, 3, 2, 1, 0 ]\n*/\nfunction assign( out, stride, offset ) {\n\tvar obj = arraylike2object( out );\n\tif ( obj.accessorProtocol ) {\n\t\t// If provided a complex number array, reinterpret as a real typed array and only set the real components...\n\t\tif ( obj.dtype === 'complex128' ) {\n\t\t\treturn complex( out, reinterpret128( out, 0 ), stride, offset );\n\t\t}\n\t\tif ( obj.dtype === 'complex64' ) {\n\t\t\treturn complex( out, reinterpret64( out, 0 ), stride, offset );\n\t\t}\n\t\treturn accessors( obj, stride, offset );\n\t}\n\treturn indexed( out, stride, offset );\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeroTo from '@stdlib/array-base-zero-to';\nimport copy from '@stdlib/array-base-copy-indexed';\nimport take from '@stdlib/array-base-take-indexed';\nimport sort2ins from './sort2ins.js';\n\n\n// MAIN //\n\n/**\n* Reorders ndarray dimensions and associated strides for loop interchange.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **sh**: dimensions sorted in loop order.\n* - **sx**: ndarray strides sorted in loop order.\n* - **idx**: dimension indices sorted in loop order.\n*\n* @param {NonNegativeIntegerArray} sh - array dimensions\n* @param {IntegerArray} sx - array stride lengths\n* @returns {Object} loop interchange data\n*\n* @example\n* var sh = [ 2, 3, 4 ];\n*\n* var sx = [ 12, 4, 1 ]; // row-major\n*\n* var o = loopOrder( sh, sx );\n* // returns {...}\n*\n* var ssh = o.sh;\n* // returns [ 4, 3, 2 ]\n*\n* var ssx = o.sx;\n* // returns [ 1, 4, 12 ]\n*\n* var idx = o.idx;\n* // returns [ 2, 1, 0 ]\n*/\nfunction loopOrder( sh, sx ) {\n\tvar idx;\n\n\t// Initialize a loop interchange index array for generating a loop order permutation:\n\tidx = zeroTo( sh.length );\n\n\t// Sort the array strides in increasing order (of magnitude):\n\tsx = copy( sx );\n\tsort2ins( sx, idx );\n\n\t// Permute the shape based on the sorted array strides:\n\tsh = take( sh, idx );\n\n\treturn {\n\t\t'sh': sh,\n\t\t'sx': sx,\n\t\t'idx': idx\n\t};\n}\n\n\n// EXPORTS //\n\nexport default loopOrder;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Simultaneously sorts two arrays based on the sort order of the first array using insertion sort.\n*\n* ## Notes\n*\n* - The first array is sorted in increasing order according to absolute value.\n* - The algorithm has space complexity `O(1)` and worst case time complexity `O(N^2)`.\n* - The algorithm is efficient for small arrays (typically `N <= 20`) and is particularly efficient for sorting arrays which are already substantially sorted.\n* - The algorithm is **stable**, meaning that the algorithm does **not** change the order of array elements which are equal or equivalent.\n* - The input arrays are sorted in-place (i.e., the input arrays are mutated).\n*\n* @private\n* @param {Array} x - first array\n* @param {Array} y - second array\n* @returns {void}\n*\n* @example\n* var x = [ -4, -2, 3, 1 ];\n* var y = [ 0, 1, 2, 3 ];\n*\n* sort2ins( x, y );\n*\n* console.log( x );\n* // => [ 1, -2, 3, -4 ]\n*\n* console.log( y );\n* // => [ 3, 1, 2, 0 ]\n*/\nfunction sort2ins( x, y ) {\n\tvar avx;\n\tvar aux;\n\tvar ix;\n\tvar iy;\n\tvar jx;\n\tvar jy;\n\tvar vx;\n\tvar vy;\n\tvar ux;\n\tvar i;\n\n\tix = 1;\n\tiy = 1;\n\n\t// Sort in increasing order...\n\tfor ( i = 1; i < x.length; i++ ) {\n\t\tvx = x[ ix ];\n\t\tavx = ( vx < 0 ) ? -vx : vx;\n\n\t\tvy = y[ iy ];\n\n\t\tjx = ix - 1;\n\t\tjy = iy - 1;\n\n\t\t// Shift all larger values to the left of the current element to the right...\n\t\twhile ( jx >= 0 ) {\n\t\t\tux = x[ jx ];\n\t\t\taux = ( ux < 0 ) ? -ux : ux;\n\t\t\tif ( aux <= avx ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tx[ jx+1 ] = ux;\n\t\t\ty[ jy+1 ] = y[ jy ];\n\t\t\tjx -= 1;\n\t\t\tjy -= 1;\n\t\t}\n\t\tx[ jx+1 ] = vx;\n\t\ty[ jy+1 ] = vy;\n\t\tix += 1;\n\t\tiy += 1;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default sort2ins;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Takes elements from an indexed array.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} indices - list of indices\n* @returns {Array} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n* var indices = [ 3, 1, 2, 0 ];\n*\n* var y = take( x, indices );\n* // returns [ 4, 2, 3, 1 ]\n*/\nfunction take( x, indices ) {\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < indices.length; i++ ) {\n\t\tout.push( x[ indices[ i ] ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default take;\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 isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\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 { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\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 positive integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a positive integer\n*\n* @example\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( 0.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( null );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\treturn Object.keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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* Multiply a vector by a scalar constant.\n*\n* @module @stdlib/blas-base-gscal\n*\n* @example\n* import gscal from '@stdlib/blas-base-gscal';\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal( x.length, 5.0, x, 1 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*\n* @example\n* import gscal from '@stdlib/blas-base-gscal';\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gscal.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\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* Generate a linearly spaced numeric array whose elements increment by 1 starting from zero.\n*\n* @module @stdlib/array-base-zero-to\n*\n* @example\n* import zeroTo from '@stdlib/array-base-zero-to';\n*\n* var arr = zeroTo( 6 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*\n* @example\n* import zeroTo from '@stdlib/array-base-zero-to';\n*\n* var out = [ 0, 0, 0, 0, 0, 0 ];\n* var arr = zeroTo.assign( out, 1, 0 );\n* // returns [ 0, 1, 2, 3, 4, 5 ]\n*\n* var bool = ( out === arr );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a positive integer.\n*\n* @module @stdlib/assert-is-positive-integer\n*\n* @example\n* import isPositiveInteger from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* bool = isPositiveInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\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// MAIN //\n\nvar bool = ( typeof Object.keys !== 'undefined' );\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// MODULES //\n\nimport isArguments from './main.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment returns the expected internal class of the `arguments` object.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment behaves as expected\n*\n* @example\n* var bool = detect();\n* // returns \n*/\nfunction detect() {\n\treturn isArguments( arguments );\n}\n\n\n// MAIN //\n\nbool = detect();\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// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn ( nativeClass( value ) === '[object Arguments]' );\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\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 if a double-precision floating-point numeric value is `NaN`.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 7.0 );\n* // returns false\n*/\nfunction isnan( x ) {\n\treturn ( x !== x );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\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 isNan from '@stdlib/math-base-assert-is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a `NaN` number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `NaN` number primitive\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\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 { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isNan from '@stdlib/math-base-assert-is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a value of `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a value of `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\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 `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( null );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\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 `NaN`.\n*\n* @module @stdlib/assert-is-nan\n*\n* @example\n* import isnan from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isnan } from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\n* // returns false\n*\n* @example\n* import { isObject as isnan } from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\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// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @private\n* @name isEnumerableProperty\n* @type {Function}\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty.call( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty.call( beep, 'hasOwnProperty' );\n* // returns false\n*/\nvar isEnumerableProperty = Object.prototype.propertyIsEnumerable;\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\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 isEnum from './native.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment has a bug where String indices are not detected as \"enumerable\" properties. Observed in Node v0.10.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment has the bug\n*/\nfunction detect() {\n\treturn !isEnum.call( 'beep', '0' );\n}\n\n\n// MAIN //\n\nbool = detect();\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// MODULES //\n\nimport isString from '@stdlib/assert-is-string';\nimport { isPrimitive as isnan } from '@stdlib/assert-is-nan';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isEnum from './native.js';\nimport hasStringEnumBug from './has_string_enumerability_bug.js';\n\n\n// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );\n* // returns false\n*/\nfunction isEnumerableProperty( value, property ) {\n\tvar bool;\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\tbool = isEnum.call( value, property );\n\tif ( !bool && hasStringEnumBug && isString( value ) ) {\n\t\t// Note: we only check for indices, as properties attached to a `String` object are properly detected as enumerable above.\n\t\tproperty = +property;\n\t\treturn (\n\t\t\t!isnan( property ) &&\n\t\t\tisInteger( property ) &&\n\t\t\tproperty >= 0 &&\n\t\t\tproperty < value.length\n\t\t);\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\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 an `arguments` object.\n*\n* @module @stdlib/assert-is-arguments\n*\n* @example\n* import isArguments from '@stdlib/assert-is-arguments';\n*\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* bool = isArguments( [] );\n* // returns false\n*/\n\n// MODULES //\n\nimport hasArgumentsClass from './detect.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar isArguments;\nif ( hasArgumentsClass ) {\n\tisArguments = main;\n} else {\n\tisArguments = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\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 isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\nimport isArray from '@stdlib/assert-is-array';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-uint32-max';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object' &&\n\t\t!isArray( value ) &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH &&\n\t\thasOwnProp( value, 'callee' ) &&\n\t\t!isEnumerableProperty( value, 'callee' )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\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 isArguments from '@stdlib/assert-is-arguments';\nimport builtin from './builtin.js';\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tif ( isArguments( value ) ) {\n\t\treturn builtin( slice.call( value ) );\n\t}\n\treturn builtin( value );\n}\n\n\n// EXPORTS //\n\nexport default keys;\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 isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\nimport noop from '@stdlib/utils-noop';\n\n\n// MAIN //\n\n// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...\nvar bool = isEnumerableProperty( noop, 'prototype' );\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/**\n* No operation.\n*\n* @example\n* noop();\n* // ...does nothing.\n*/\nfunction noop() {\n\t// Empty function...\n}\n\n\n// EXPORTS //\n\nexport default noop;\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 isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\n\n\n// VARIABLES //\n\nvar obj = {\n\t'toString': null\n};\n\n\n// MAIN //\n\n// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...\nvar bool = !isEnumerableProperty( obj, 'toString' );\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// MODULES //\n\nimport isnan from '@stdlib/assert-is-nan';\nimport isCollection from '@stdlib/assert-is-collection';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @param {ArrayLike} arr - array-like object\n* @param {*} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)\n* @throws {TypeError} must provide an array-like object\n* @throws {TypeError} third argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 5 );\n* // returns -1\n*\n* @example\n* // Using a `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* @example\n* // `fromIndex` which exceeds `array` length:\n* var arr = [ 1, 2, 3, 4, 2, 5 ];\n* var idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* @example\n* // Negative `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* var idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* @example\n* // Negative `fromIndex` exceeding input `array` length:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* @example\n* // Array-like objects:\n* var str = 'bebop';\n* var idx = indexOf( str, 'o' );\n* // returns 3\n*/\nfunction indexOf( arr, searchElement, fromIndex ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( len === 0 ) {\n\t\treturn -1;\n\t}\n\tif ( arguments.length === 3 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= 0 ) {\n\t\t\tif ( fromIndex >= len ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti = fromIndex;\n\t\t} else {\n\t\t\ti = len + fromIndex;\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\ti = 0;\n\t}\n\t// Check for `NaN`...\n\tif ( isnan( searchElement ) ) {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( isnan( arr[i] ) ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( arr[ i ] === searchElement ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// EXPORTS //\n\nexport default indexOf;\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 whether a value equals the prototype of its constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction isConstructorPrototype( value ) {\n\treturn ( value.constructor && value.constructor.prototype === value );\n}\n\n\n// EXPORTS //\n\nexport default isConstructorPrototype;\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 w = ( typeof window === 'undefined' ) ? void 0 : window;\n\n\n// EXPORTS //\n\nexport default w;\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 indexOf from '@stdlib/utils-index-of';\nimport typeOf from '@stdlib/utils-type-of';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport EXCLUDED_KEYS from './excluded_keys.json';\nimport win from './window.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).\n*\n* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment is buggy\n*/\nfunction check() {\n\tvar k;\n\tif ( typeOf( win ) === 'undefined' ) {\n\t\treturn false;\n\t}\n\tfor ( k in win ) { // eslint-disable-line guard-for-in\n\t\ttry {\n\t\t\tif (\n\t\t\t\tindexOf( EXCLUDED_KEYS, k ) === -1 &&\n\t\t\t\thasOwnProp( win, k ) &&\n\t\t\t\twin[ k ] !== null &&\n\t\t\t\ttypeOf( win[ k ] ) === 'object'\n\t\t\t) {\n\t\t\t\tisConstructorPrototype( win[ k ] );\n\t\t\t}\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\nbool = check();\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// MAIN //\n\nvar bool = ( typeof window !== 'undefined' );\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// MODULES //\n\nimport hasArgumentsBug from './has_arguments_bug.js';\nimport HAS_BUILTIN from './has_builtin.js';\nimport builtin from './builtin.js';\nimport wrapper from './builtin_wrapper.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @name keys\n* @type {Function}\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nvar keys;\nif ( HAS_BUILTIN ) {\n\tif ( hasArgumentsBug() ) {\n\t\tkeys = wrapper;\n\t} else {\n\t\tkeys = builtin;\n\t}\n} else {\n\tkeys = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default keys;\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 keys from './builtin.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests the built-in `Object.keys()` implementation when provided `arguments`.\n*\n* @private\n* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys\n*/\nfunction test() {\n\treturn ( keys( arguments ) || '' ).length !== 2;\n}\n\n\n// MAIN //\n\n/**\n* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.\n*\n* ## Notes\n*\n* - Safari 5.0 does **not** support `arguments` as an input value.\n*\n* @private\n* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`\n*/\nfunction check() {\n\treturn test( 1, 2 );\n}\n\n\n// EXPORTS //\n\nexport default check;\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 isObjectLike from '@stdlib/assert-is-object-like';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport isArguments from '@stdlib/assert-is-arguments';\nimport HAS_ENUM_PROTO_BUG from './has_enumerable_prototype_bug.js';\nimport HAS_NON_ENUM_PROPS_BUG from './has_non_enumerable_properties_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype_wrapper.js';\nimport NON_ENUMERABLE from './non_enumerable.json';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tvar skipConstructor;\n\tvar skipPrototype;\n\tvar isFcn;\n\tvar out;\n\tvar k;\n\tvar p;\n\tvar i;\n\n\tout = [];\n\tif ( isArguments( value ) ) {\n\t\t// Account for environments which treat `arguments` differently...\n\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\tout.push( i.toString() );\n\t\t}\n\t\t// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).\n\t\treturn out;\n\t}\n\tif ( typeof value === 'string' ) {\n\t\t// Account for environments which do not treat string character indices as \"own\" properties...\n\t\tif ( value.length > 0 && !hasOwnProp( value, '0' ) ) {\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\tout.push( i.toString() );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tisFcn = ( typeof value === 'function' );\n\t\tif ( isFcn === false && !isObjectLike( value ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tskipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );\n\t}\n\tfor ( k in value ) {\n\t\tif ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {\n\t\t\tout.push( String( k ) );\n\t\t}\n\t}\n\tif ( HAS_NON_ENUM_PROPS_BUG ) {\n\t\tskipConstructor = isConstructorPrototype( value );\n\t\tfor ( i = 0; i < NON_ENUMERABLE.length; i++ ) {\n\t\t\tp = NON_ENUMERABLE[ i ];\n\t\t\tif ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {\n\t\t\t\tout.push( String( p ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default keys;\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 hasAutomationEqualityBug from './has_automation_equality_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport HAS_WINDOW from './has_window.js';\n\n\n// MAIN //\n\n/**\n* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction wrapper( value ) {\n\tif ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {\n\t\treturn isConstructorPrototype( value );\n\t}\n\ttry {\n\t\treturn isConstructorPrototype( value );\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrapper;\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 isFunction from '@stdlib/assert-is-function';\nimport builtin from './native.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar getProto;\nif ( isFunction( Object.getPrototypeOf ) ) {\n\tgetProto = builtin;\n} else {\n\tgetProto = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\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 an object.\n*\n* @name Object\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {Object} object\n*\n* @example\n* var o = new Object( null );\n* // returns {}\n*\n* @example\n* var o = new Object( 5.0 );\n* // returns \n*\n* @example\n* var o = new Object( 'beep' );\n* // returns \n*\n* @example\n* var o1 = {};\n*\n* var o2 = new Object( o1 );\n* // returns {}\n*\n* var bool = ( o1 === o2 );\n* // returns true\n*/\nvar Obj = Object; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Obj;\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 getProto = Object.getPrototypeOf;\n\n\n// EXPORTS //\n\nexport default getProto;\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';\nimport Object from '@stdlib/object-ctor';\nimport getProto from './proto.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {(Object|null)} prototype\n*/\nfunction getPrototypeOf( obj ) {\n\tvar proto = getProto( obj );\n\tif ( proto || proto === null ) {\n\t\treturn proto;\n\t}\n\tif ( nativeClass( obj.constructor ) === '[object Function]' ) {\n\t\t// May break if the constructor has been tampered with...\n\t\treturn obj.constructor.prototype;\n\t}\n\tif ( obj instanceof Object ) {\n\t\treturn Object.prototype;\n\t}\n\t// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\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* Returns the value of the `__proto__` property.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {*} value of `__proto__` property\n*/\nfunction getProto( obj ) {\n\t// eslint-disable-next-line no-proto\n\treturn obj.__proto__;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\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 isObject from '@stdlib/assert-is-object';\nimport isFunction from '@stdlib/assert-is-function';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar objectPrototype = Object.prototype;\n\n\n// FUNCTIONS //\n\n/**\n* Tests that an object only has own properties.\n*\n* @private\n* @param {Object} obj - value to test\n* @returns {boolean} boolean indicating if an object only has own properties\n*/\nfunction ownProps( obj ) {\n\tvar key;\n\n\t// NOTE: possibility of perf boost if key enumeration order is known (see http://stackoverflow.com/questions/18531624/isplainobject-thing).\n\tfor ( key in obj ) {\n\t\tif ( !hasOwnProp( obj, key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// MAIN //\n\n/**\n* Tests if a value is a plain object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a plain object\n*\n* @example\n* var bool = isPlainObject( {} );\n* // returns true\n*\n* @example\n* var bool = isPlainObject( null );\n* // returns false\n*/\nfunction isPlainObject( value ) {\n\tvar proto;\n\n\t// Screen for obvious non-objects...\n\tif ( !isObject( value ) ) {\n\t\treturn false;\n\t}\n\t// Objects with no prototype (e.g., `Object.create( null )`) are plain...\n\tproto = getPrototypeOf( value );\n\tif ( !proto ) {\n\t\treturn true;\n\t}\n\t// Objects having a prototype are plain if and only if they are constructed with a global `Object` function and the prototype points to the prototype of a plain object...\n\treturn (\n\t\t// Cannot have own `constructor` property:\n\t\t!hasOwnProp( value, 'constructor' ) &&\n\n\t\t// Prototype `constructor` property must be a function (see also https://bugs.jquery.com/ticket/9897 and http://stackoverflow.com/questions/18531624/isplainobject-thing):\n\t\thasOwnProp( proto, 'constructor' ) &&\n\t\tisFunction( proto.constructor ) &&\n\t\tnativeClass( proto.constructor ) === '[object Function]' &&\n\n\t\t// Test for object-specific method:\n\t\thasOwnProp( proto, 'isPrototypeOf' ) &&\n\t\tisFunction( proto.isPrototypeOf ) &&\n\n\t\t(\n\t\t\t// Test if the prototype matches the global `Object` prototype (same realm):\n\t\t\tproto === objectPrototype ||\n\n\t\t\t// Test that all properties are own properties (cross-realm; *most* likely a plain object):\n\t\t\townProps( value )\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPlainObject;\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 Object from '@stdlib/object-ctor';\nimport getProto from './detect.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @param {*} value - input value\n* @returns {(Object|null)} prototype\n*\n* @example\n* var proto = getPrototypeOf( {} );\n* // returns {}\n*/\nfunction getPrototypeOf( value ) {\n\tif (\n\t\tvalue === null ||\n\t\tvalue === void 0\n\t) {\n\t\treturn null;\n\t}\n\t// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:\n\tvalue = Object( value );\n\n\treturn getProto( value );\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\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 { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport objectInverse from '@stdlib/object-inverse';\nimport dtypeEnums from '@stdlib/ndarray-base-dtype-enums';\n\n\n// VARIABLES //\n\nvar hash = objectInverse( dtypeEnums(), {\n\t'duplicates': false\n});\n\n\n// MAIN //\n\n/**\n* Returns the data type string associated with an ndarray data type enumeration constant.\n*\n* @param {integer} dtype - data type enumeration constant\n* @returns {(string|null)} data type string or null\n*\n* @example\n* import str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n*\n* var v = str2enum( 'float64' );\n* // returns \n*\n* var dt = enum2str( v );\n* // returns 'float64'\n*/\nfunction enum2str( dtype ) {\n\tvar v = hash[ dtype ];\n\treturn ( isString( v ) ) ? v : null; // note: we include this guard to prevent walking the prototype chain\n}\n\n\n// EXPORTS //\n\nexport default enum2str;\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 objectKeys from '@stdlib/utils-keys';\nimport isArray from '@stdlib/assert-is-array';\nimport isObject from '@stdlib/assert-is-plain-object';\nimport isObjectLike from '@stdlib/assert-is-object-like';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Inverts an object, such that keys become values and values become keys.\n*\n* @param {ObjectLike} obj - input object\n* @param {Options} [opts] - function options\n* @param {boolean} [opts.duplicates=true] - boolean indicating whether to store duplicate keys\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} second argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Object} inverted object\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'boop'\n* });\n* // returns { 'beep': 'a', 'boop': 'b' }\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'beep'\n* });\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var out = invert( obj, {\n* 'duplicates': false\n* });\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\nfunction invert( obj, opts ) {\n\tvar allowDupes = true;\n\tvar keys;\n\tvar len;\n\tvar key;\n\tvar val;\n\tvar out;\n\tvar v;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'duplicates' ) ) {\n\t\t\tallowDupes = opts.duplicates;\n\t\t\tif ( !isBoolean( allowDupes ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'duplicates', allowDupes ) );\n\t\t\t}\n\t\t}\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = {};\n\tif ( allowDupes ) {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = obj[ key ];\n\t\t\tif ( !hasOwnProp( out, val ) ) {\n\t\t\t\tout[ val ] = key;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tv = out[ val ];\n\t\t\tif ( isArray( v ) ) {\n\t\t\t\tout[ val ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ val ] = [ v, key ];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tout[ obj[ key ] ] = key;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default invert;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 stdlib/empty-line-before-comment */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping supported data type strings to enumeration constants.\n*\n* ## Notes\n*\n* - Downstream consumers of this mapping should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the object should be used in an opaque manner.\n* - The main purpose of this function is JavaScript and C inter-operation of ndarray objects.\n*\n* @returns {Object} object mapping supported data type strings to enumeration constants\n*\n* @example\n* var table = dtypeEnums();\n* // returns {...}\n*/\nfunction dtypeEnums() {\n\t// NOTE: the following should match the C enumeration in `@stdlib/ndarray/dtypes`!!!!\n\treturn {\n\t\t// Boolean data types:\n\t\t'bool': 0,\n\n\t\t// Integer data types:\n\t\t'int8': 1,\n\t\t'uint8': 2,\n\t\t'uint8c': 3,\n\t\t'int16': 4,\n\t\t'uint16': 5,\n\t\t'int32': 6,\n\t\t'uint32': 7,\n\t\t'int64': 8,\n\t\t'uint64': 9,\n\t\t// 'int128': 10, // uncomment once supported\n\t\t// 'uint128': 11,\n\t\t// 'int256': 12,\n\t\t// 'uint256': 13,\n\n\t\t// Floating-point data types:\n\t\t'float16': 10,\n\t\t// 'bfloat16': 15,\n\t\t'float32': 11,\n\t\t'float64': 12,\n\t\t// 'float128': 18, // uncomment once supported\n\n\t\t// Complex floating-point number data types:\n\t\t'complex32': 13,\n\t\t'complex64': 14,\n\t\t'complex128': 15,\n\n\t\t// Data type for \"binary\" data (i.e., data stored in a Node.js `Buffer` object):\n\t\t'binary': 16,\n\n\t\t// Data type for \"generic\" JavaScript values (objects):\n\t\t'generic': 17,\n\n\t\t// Define a signaling value which is guaranteed not to be a valid type enumeration value:\n\t\t'notype': 18,\n\n\t\t// Indicate the start of user defined type numbers (leaving room for type growth above):\n\t\t'userdefined_type': 256\n\t};\n}\n\n\n// EXPORTS //\n\nexport default dtypeEnums;\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 isString } from '@stdlib/assert-is-string';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport enum2str from '@stdlib/ndarray-base-dtype-enum2str';\nimport BYTES_PER_ELEMENT from './bytes_per_element.json';\n\n\n// MAIN //\n\n/**\n* Returns the number of bytes per element for a provided underlying ndarray data type.\n*\n* @param {*} dtype - data type\n* @returns {(PositiveInteger|null)} number of bytes per element\n*\n* @example\n* var nbytes = bytesPerElement( 'float64' );\n* // returns 8\n*\n* nbytes = bytesPerElement( 'generic' );\n* // returns null\n*\n* @example\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var schema = [\n* {\n* 'name': 'value',\n* 'type': 'float64'\n* }\n* ];\n* var Struct = structFactory( schema );\n* // returns \n*\n* var nbytes = bytesPerElement( Struct );\n* // returns 8\n*/\nfunction bytesPerElement( dtype ) {\n\tvar v;\n\tif ( isString( dtype ) ) {\n\t\treturn BYTES_PER_ELEMENT[ dtype ] || null;\n\t}\n\tif ( isNumber( dtype ) ) {\n\t\treturn BYTES_PER_ELEMENT[ enum2str( dtype ) ] || null;\n\t}\n\tif ( dtype ) {\n\t\tv = dtype.byteLength;\n\t\tif ( isPositiveInteger( v ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default bytesPerElement;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2026 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 defaults = {\n\t// Define a default block size (in bytes):\n\t'BLOCK_SIZE_IN_BYTES': 64|0, // 64b is a common cache line size. How applicable the common cache line size is here is debatable, given that, depending on the associated stride(s), the innermost loop may not iterate over adjacent elements. The primary goal is to have a block size in which all data within a block can always fit in (L1) cache, regardless of cache size (i.e., cache-oblivious). For reference, a common L1 cache size is 32kB per core. For best performance, block sizes should be tuned based on system hardware; however, such tuning is not readily available to us here. Without obvious better alternatives, 64b has some theoretical (and practical) underpinning, and it should be good enough for most inputs, especially for ndarrays with near contiguity.\n\n\t// Define a default block size (in elements):\n\t'BLOCK_SIZE_IN_ELEMENTS': 8|0 // 64 bytes / 8 bytes per element (i.e., default element size is same as a double)\n};\n\n\n// EXPORTS //\n\nexport default defaults;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 blockSize from '@stdlib/ndarray-base-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Returns a loop block size for multi-dimensional array tiled loops.\n*\n* @param {*} dtypeX - array data type\n* @returns {integer} block size (in units of elements)\n*\n* @example\n* var bsize = nullaryBlockSize( 'float64' );\n* // returns \n*/\nfunction nullaryBlockSize( dtypeX ) {\n\treturn blockSize( [ dtypeX ] );\n}\n\n\n// EXPORTS //\n\nexport default nullaryBlockSize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2026 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 bytesPerElement from '@stdlib/ndarray-base-bytes-per-element';\nimport defaults from './defaults.js';\n\n\n// MAIN //\n\n/**\n* Returns a loop block size for multi-dimensional array tiled loops.\n*\n* @param {ArrayLikeObject} dtypes - list of input and output ndarray data types\n* @returns {integer} block size (in units of elements)\n*\n* @example\n* var bsize = blockSize( [ 'float64', 'float64', 'float64', 'float64' ] );\n* // returns \n*/\nfunction blockSize( dtypes ) {\n\tvar max;\n\tvar len;\n\tvar nb;\n\tvar i;\n\n\tlen = dtypes.length;\n\tif ( len <= 0 ) {\n\t\treturn defaults.BLOCK_SIZE_IN_ELEMENTS;\n\t}\n\tmax = bytesPerElement( dtypes[ 0 ] );\n\tif ( max === null ) {\n\t\treturn defaults.BLOCK_SIZE_IN_ELEMENTS; // e.g., \"generic\" arrays\n\t}\n\t// Find the largest element size among all arrays...\n\tfor ( i = 1; i < len; i++ ) {\n\t\tnb = bytesPerElement( dtypes[ i ] );\n\t\tif ( nb === null ) {\n\t\t\treturn defaults.BLOCK_SIZE_IN_ELEMENTS; // e.g., \"generic\" arrays\n\t\t}\n\t\tif ( nb > max ) {\n\t\t\tmax = nb;\n\t\t}\n\t}\n\tnb = ( defaults.BLOCK_SIZE_IN_BYTES/max )|0; // asm type annotation\n\treturn ( nb > 0 ) ? nb : 1|0;\n}\n\n\n// EXPORTS //\n\nexport default blockSize;\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 isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Converts a linear index in an array view to a linear index in an underlying data buffer.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @param {NonNegativeInteger} offset - location of the first indexed value **based** on the stride array\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @param {integer} idx - linear index in an array view\n* @param {string} mode - specifies how to handle a linear index which exceeds array dimensions\n* @throws {RangeError} linear index must not exceed array dimensions\n* @returns {NonNegativeInteger} linear index in an underlying data buffer\n*\n* @example\n* var shape = [ 3, 3 ];\n* var strides = [ -3, 1 ];\n* var offset = 6;\n* var order = 'row-major';\n* var mode = 'throw';\n*\n* var ind = vind2bind( shape, strides, offset, order, 1, mode );\n* // returns 7\n*/\nfunction vind2bind( shape, strides, offset, order, idx, mode ) {\n\tvar ndims;\n\tvar len;\n\tvar ind;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tlen = 1;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tlen *= shape[ i ];\n\t}\n\tif ( mode === 'clamp' ) {\n\t\tif ( idx < 0 ) {\n\t\t\tidx = 0;\n\t\t} else if ( idx >= len ) {\n\t\t\tidx = len - 1;\n\t\t}\n\t} else if ( mode === 'wrap' ) {\n\t\tif ( idx < 0 ) {\n\t\t\tidx += len; // slight optimization to avoid modulo arithmetic when |idx| <= len\n\t\t\tif ( idx < 0 ) {\n\t\t\t\tidx %= len;\n\t\t\t\tif ( idx !== 0 ) {\n\t\t\t\t\tidx += len;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( idx >= len ) {\n\t\t\tidx -= len; // slight optimization to avoid modulo arithmetic when len < idx <= 2*len\n\t\t\tif ( idx >= len ) {\n\t\t\t\tidx %= len;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ( mode === 'normalize' && idx < 0 ) {\n\t\t\tidx += len;\n\t\t}\n\t\tif ( idx < 0 || idx >= len ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.', len, idx ) );\n\t\t}\n\t}\n\t// The approach which follows is to resolve a view index to its subscripts and then plug the subscripts into the standard formula for computing the linear index in the underlying data buffer...\n\tind = offset;\n\tif ( isColumnMajor( order ) ) {\n\t\tfor ( i = 0; i < ndims; i++ ) {\n\t\t\ts = idx % shape[ i ];\n\t\t\tidx -= s;\n\t\t\tidx /= shape[ i ];\n\t\t\tind += s * strides[ i ];\n\t\t}\n\t\treturn ind;\n\t}\n\t// Case: row-major\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\ts = idx % shape[ i ];\n\t\tidx -= s;\n\t\tidx /= shape[ i ];\n\t\tind += s * strides[ i ];\n\t}\n\treturn ind;\n}\n\n\n// EXPORTS //\n\nexport default vind2bind;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport numel from '@stdlib/ndarray-base-numel';\nimport vind2bind from '@stdlib/ndarray-base-vind2bind';\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar get;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !get( xbuf, ix ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default everynd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport numel from '@stdlib/ndarray-base-numel';\nimport vind2bind from '@stdlib/ndarray-base-vind2bind';\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default everynd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport numel from '@stdlib/ndarray-base-numel';\nimport vind2bind from '@stdlib/ndarray-base-vind2bind';\n\n\n// VARIABLES //\n\nvar MODE = 'throw';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = everynd( x );\n* // returns true\n*/\nfunction everynd( x ) {\n\tvar xbuf;\n\tvar ordx;\n\tvar len;\n\tvar sh;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i;\n\n\tsh = x.shape;\n\n\t// Compute the total number of elements over which to iterate:\n\tlen = numel( sh );\n\n\t// Cache a reference to the output ndarray data buffer:\n\txbuf = x.data;\n\n\t// Cache a reference to the stride array:\n\tsx = x.strides;\n\n\t// Cache the index of the first indexed element:\n\tox = x.offset;\n\n\t// Cache the array order:\n\tordx = x.order;\n\n\t// Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tix = vind2bind( sh, sx, ox, ordx, i, MODE );\n\t\tif ( !xbuf[ ix ] ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default everynd;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 isComplexArray from '@stdlib/array-base-assert-is-complex-typed-array';\nimport isBooleanArray from '@stdlib/array-base-assert-is-booleanarray';\nimport iterationOrder from '@stdlib/ndarray-base-iteration-order';\nimport minmaxViewBufferIndex from '@stdlib/ndarray-base-minmax-view-buffer-index';\nimport ndarray2object from '@stdlib/ndarray-base-ndarraylike2object';\nimport reinterpretComplex from '@stdlib/strided-base-reinterpret-complex';\nimport reinterpretBoolean from '@stdlib/strided-base-reinterpret-boolean';\nimport gscal from '@stdlib/blas-base-gscal';\nimport blockedaccessorevery2d from './2d_blocked_accessors.js';\nimport blockedaccessorevery3d from './3d_blocked_accessors.js';\nimport blockedaccessorevery4d from './4d_blocked_accessors.js';\nimport blockedaccessorevery5d from './5d_blocked_accessors.js';\nimport blockedaccessorevery6d from './6d_blocked_accessors.js';\nimport blockedaccessorevery7d from './7d_blocked_accessors.js';\nimport blockedaccessorevery8d from './8d_blocked_accessors.js';\nimport blockedaccessorevery9d from './9d_blocked_accessors.js';\nimport blockedaccessorevery10d from './10d_blocked_accessors.js';\nimport blockedcomplexevery2d from './2d_blocked_complex.js';\nimport blockedcomplexevery3d from './3d_blocked_complex.js';\nimport blockedcomplexevery4d from './4d_blocked_complex.js';\nimport blockedcomplexevery5d from './5d_blocked_complex.js';\nimport blockedcomplexevery6d from './6d_blocked_complex.js';\nimport blockedcomplexevery7d from './7d_blocked_complex.js';\nimport blockedcomplexevery8d from './8d_blocked_complex.js';\nimport blockedcomplexevery9d from './9d_blocked_complex.js';\nimport blockedcomplexevery10d from './10d_blocked_complex.js';\nimport blockedevery2d from './2d_blocked.js';\nimport blockedevery3d from './3d_blocked.js';\nimport blockedevery4d from './4d_blocked.js';\nimport blockedevery5d from './5d_blocked.js';\nimport blockedevery6d from './6d_blocked.js';\nimport blockedevery7d from './7d_blocked.js';\nimport blockedevery8d from './8d_blocked.js';\nimport blockedevery9d from './9d_blocked.js';\nimport blockedevery10d from './10d_blocked.js';\nimport accessorevery0d from './0d_accessors.js';\nimport accessorevery1d from './1d_accessors.js';\nimport accessorevery2d from './2d_accessors.js';\nimport accessorevery3d from './3d_accessors.js';\nimport accessorevery4d from './4d_accessors.js';\nimport accessorevery5d from './5d_accessors.js';\nimport accessorevery6d from './6d_accessors.js';\nimport accessorevery7d from './7d_accessors.js';\nimport accessorevery8d from './8d_accessors.js';\nimport accessorevery9d from './9d_accessors.js';\nimport accessorevery10d from './10d_accessors.js';\nimport accessoreverynd from './nd_accessors.js';\nimport complexevery0d from './0d_complex.js';\nimport complexevery1d from './1d_complex.js';\nimport complexevery2d from './2d_complex.js';\nimport complexevery3d from './3d_complex.js';\nimport complexevery4d from './4d_complex.js';\nimport complexevery5d from './5d_complex.js';\nimport complexevery6d from './6d_complex.js';\nimport complexevery7d from './7d_complex.js';\nimport complexevery8d from './8d_complex.js';\nimport complexevery9d from './9d_complex.js';\nimport complexevery10d from './10d_complex.js';\nimport complexeverynd from './nd_complex.js';\nimport every0d from './0d.js';\nimport every1d from './1d.js';\nimport every2d from './2d.js';\nimport every3d from './3d.js';\nimport every4d from './4d.js';\nimport every5d from './5d.js';\nimport every6d from './6d.js';\nimport every7d from './7d.js';\nimport every8d from './8d.js';\nimport every9d from './9d.js';\nimport every10d from './10d.js';\nimport everynd from './nd.js';\n\n\n// VARIABLES //\n\nvar EVERY = [\n\tevery0d,\n\tevery1d,\n\tevery2d,\n\tevery3d,\n\tevery4d,\n\tevery5d,\n\tevery6d,\n\tevery7d,\n\tevery8d,\n\tevery9d,\n\tevery10d\n];\nvar ACCESSOR_EVERY = [\n\taccessorevery0d,\n\taccessorevery1d,\n\taccessorevery2d,\n\taccessorevery3d,\n\taccessorevery4d,\n\taccessorevery5d,\n\taccessorevery6d,\n\taccessorevery7d,\n\taccessorevery8d,\n\taccessorevery9d,\n\taccessorevery10d\n];\nvar COMPLEX_EVERY = [\n\tcomplexevery0d,\n\tcomplexevery1d,\n\tcomplexevery2d,\n\tcomplexevery3d,\n\tcomplexevery4d,\n\tcomplexevery5d,\n\tcomplexevery6d,\n\tcomplexevery7d,\n\tcomplexevery8d,\n\tcomplexevery9d,\n\tcomplexevery10d\n];\nvar BLOCKED_EVERY = [\n\tblockedevery2d, // 0\n\tblockedevery3d,\n\tblockedevery4d,\n\tblockedevery5d,\n\tblockedevery6d,\n\tblockedevery7d,\n\tblockedevery8d,\n\tblockedevery9d,\n\tblockedevery10d // 8\n];\nvar BLOCKED_ACCESSOR_EVERY = [\n\tblockedaccessorevery2d, // 0\n\tblockedaccessorevery3d,\n\tblockedaccessorevery4d,\n\tblockedaccessorevery5d,\n\tblockedaccessorevery6d,\n\tblockedaccessorevery7d,\n\tblockedaccessorevery8d,\n\tblockedaccessorevery9d,\n\tblockedaccessorevery10d // 8\n];\nvar BLOCKED_COMPLEX_EVERY = [\n\tblockedcomplexevery2d, // 0\n\tblockedcomplexevery3d,\n\tblockedcomplexevery4d,\n\tblockedcomplexevery5d,\n\tblockedcomplexevery6d,\n\tblockedcomplexevery7d,\n\tblockedcomplexevery8d,\n\tblockedcomplexevery9d,\n\tblockedcomplexevery10d // 8\n];\nvar MAX_DIMS = EVERY.length - 1;\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* ## Notes\n*\n* - A provided ndarray should be an object with the following properties:\n*\n* - **dtype**: data type.\n* - **data**: data buffer.\n* - **shape**: dimensions.\n* - **strides**: stride lengths.\n* - **offset**: index offset.\n* - **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style).\n*\n* @param {ArrayLikeObject} arrays - array-like object containing one input array\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every( [ x ] );\n* // returns true\n*/\nfunction every( arrays ) {\n\tvar isCmplx;\n\tvar ndims;\n\tvar xmmv;\n\tvar shx;\n\tvar iox;\n\tvar len;\n\tvar sx;\n\tvar ox;\n\tvar ns;\n\tvar x;\n\tvar d;\n\tvar i;\n\n\t// Unpack the ndarray and standardize ndarray meta data:\n\tx = ndarray2object( arrays[ 0 ] );\n\tshx = x.shape;\n\tndims = shx.length;\n\n\t// Check for known array types which can be reinterpreted for better iteration performance...\n\tif ( isBooleanArray( x.data ) ) {\n\t\tx.data = reinterpretBoolean( x.data, 0 );\n\t\tx.accessorProtocol = false;\n\t} else if ( isComplexArray( x.data ) ) {\n\t\tx.data = reinterpretComplex( x.data, 0 );\n\t\tx.accessorProtocol = false;\n\t\tx.strides = gscal( ndims, 2, x.strides, 1 );\n\t\tx.offset *= 2;\n\t\tisCmplx = true;\n\t}\n\t// Determine whether we can avoid iteration altogether...\n\tif ( ndims === 0 ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t}\n\t\treturn EVERY[ ndims ]( x );\n\t}\n\t// Compute the number of elements and the number of singleton dimensions...\n\tlen = 1; // number of elements\n\tns = 0; // number of singleton dimensions\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\td = shx[ i ];\n\n\t\t// Note that, if one of the dimensions is `0`, the length will be `0`...\n\t\tlen *= d;\n\n\t\t// Check whether the current dimension is a singleton dimension...\n\t\tif ( d === 1 ) {\n\t\t\tns += 1;\n\t\t}\n\t}\n\t// Check whether we were provided an empty ndarray...\n\tif ( len === 0 ) {\n\t\treturn true;\n\t}\n\t// Determine whether the ndarray is one-dimensional and thus readily translates to a one-dimensional strided array...\n\tif ( ndims === 1 ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t}\n\t\treturn EVERY[ ndims ]( x );\n\t}\n\tsx = x.strides;\n\n\t// Determine whether the ndarray has only **one** non-singleton dimension (e.g., ndims=4, shape=[10,1,1,1]) so that we can treat an ndarray as being equivalent to a one-dimensional strided array...\n\tif ( ns === ndims-1 ) {\n\t\t// Get the index of the non-singleton dimension...\n\t\tfor ( i = 0; i < ndims; i++ ) {\n\t\t\tif ( shx[ i ] !== 1 ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tx.shape = [ shx[i] ];\n\t\tx.strides = [ sx[i] ];\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn ACCESSOR_EVERY[ 1 ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn COMPLEX_EVERY[ 1 ]( x );\n\t\t}\n\t\treturn EVERY[ 1 ]( x );\n\t}\n\tiox = iterationOrder( sx ); // +/-1\n\n\t// Determine whether we can avoid blocked iteration...\n\tif ( iox !== 0 ) {\n\t\t// Determine the minimum and maximum linear indices which are accessible by the array view:\n\t\txmmv = minmaxViewBufferIndex( shx, sx, x.offset );\n\n\t\t// Determine whether we can ignore shape (and strides) and treat the ndarray as a linear one-dimensional strided array...\n\t\tif ( len === ( xmmv[1]-xmmv[0]+1 ) || ( isCmplx && len*2 === ( xmmv[1]-xmmv[0]+2 ) ) ) { // eslint-disable-line max-len\n\t\t\t// Note: the above is equivalent to @stdlib/ndarray/base/assert/is-contiguous, but in-lined so we can retain computed values...\n\t\t\tif ( iox === 1 ) {\n\t\t\t\tox = xmmv[ 0 ];\n\t\t\t} else {\n\t\t\t\tox = xmmv[ 1 ];\n\t\t\t}\n\t\t\tx.shape = [ len ];\n\t\t\tx.strides = [ ( isCmplx ) ? iox*2 : iox ];\n\t\t\tx.offset = ox;\n\t\t\tif ( x.accessorProtocol ) {\n\t\t\t\treturn ACCESSOR_EVERY[ 1 ]( x );\n\t\t\t}\n\t\t\tif ( isCmplx ) {\n\t\t\t\treturn COMPLEX_EVERY[ 1 ]( x );\n\t\t\t}\n\t\t\treturn EVERY[ 1 ]( x );\n\t\t}\n\t\t// The ndarray is non-contiguous, so we cannot directly use one-dimensional array functionality...\n\n\t\t// Determine whether we can use simple nested loops...\n\t\tif ( ndims <= MAX_DIMS ) {\n\t\t\t// So long as iteration always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration...\n\t\t\tif ( x.accessorProtocol ) {\n\t\t\t\treturn ACCESSOR_EVERY[ ndims ]( x );\n\t\t\t}\n\t\t\tif ( isCmplx ) {\n\t\t\t\treturn COMPLEX_EVERY[ ndims ]( x );\n\t\t\t}\n\t\t\treturn EVERY[ ndims ]( x );\n\t\t}\n\t\t// Fall-through to blocked iteration...\n\t}\n\t// At this point, we're either dealing with a non-contiguous n-dimensional array or a high dimensional n-dimensional array, so our only hope is that we can still perform blocked iteration...\n\n\t// Determine whether we can perform blocked iteration...\n\tif ( ndims <= MAX_DIMS ) {\n\t\tif ( x.accessorProtocol ) {\n\t\t\treturn BLOCKED_ACCESSOR_EVERY[ ndims-2 ]( x );\n\t\t}\n\t\tif ( isCmplx ) {\n\t\t\treturn BLOCKED_COMPLEX_EVERY[ ndims-2 ]( x );\n\t\t}\n\t\treturn BLOCKED_EVERY[ ndims-2 ]( x );\n\t}\n\t// Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)...\n\tif ( x.accessorProtocol ) {\n\t\treturn accessoreverynd( x );\n\t}\n\tif ( isCmplx ) {\n\t\treturn complexeverynd( x );\n\t}\n\treturn everynd( x );\n}\n\n\n// EXPORTS //\n\nexport default every;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.data[ x.offset ] ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default every0d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 2 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments:\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !xbuf[ ix ] ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every1d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.accessors[ 0 ]( x.data, x.offset ) ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default every0d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments...\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !get( xbuf, ix ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every1d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache accessor:\n\tget = x.accessors[ 0 ];\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [];\n*\n* // Define the array strides:\n* var sx = [ 0 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every0d( x );\n* // returns true\n*/\nfunction every0d( x ) {\n\tif ( x.data[ x.offset ] || x.data[ x.offset+1 ] ) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default every0d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 4 ];\n*\n* // Define the array strides:\n* var sx = [ 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every1d( x );\n* // returns true\n*/\nfunction every1d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar S0;\n\tvar ix;\n\tvar i0;\n\n\t// Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables: dimensions and loop offset (pointer) increments:\n\tS0 = x.shape[ 0 ];\n\tdx0 = x.strides[ 0 ];\n\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tix += dx0;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every1d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every2d( x );\n* // returns true\n*/\nfunction every2d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 1 ];\n\t\tS1 = sh[ 0 ];\n\t\tdx0 = sx[ 1 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tix += dx0;\n\t\t}\n\t\tix += dx1;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every3d( x );\n* // returns true\n*/\nfunction every3d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 2 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 0 ];\n\t\tdx0 = sx[ 2 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[2] );\n\t\tdx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tix += dx0;\n\t\t\t}\n\t\t\tix += dx1;\n\t\t}\n\t\tix += dx2;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 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 strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every4d( x );\n* // returns true\n*/\nfunction every4d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 3 ];\n\t\tS1 = sh[ 2 ];\n\t\tS2 = sh[ 1 ];\n\t\tS3 = sh[ 0 ];\n\t\tdx0 = sx[ 3 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 2 ] - ( S0*sx[3] );\n\t\tdx2 = sx[ 1 ] - ( S1*sx[2] );\n\t\tdx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t\tix += dx2;\n\t\t}\n\t\tix += dx3;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every5d( x );\n* // returns true\n*/\nfunction every5d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 4 ];\n\t\tS1 = sh[ 3 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 1 ];\n\t\tS4 = sh[ 0 ];\n\t\tdx0 = sx[ 4 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 3 ] - ( S0*sx[4] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[3] );\n\t\tdx3 = sx[ 1 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx1;\n\t\t\t\t}\n\t\t\t\tix += dx2;\n\t\t\t}\n\t\t\tix += dx3;\n\t\t}\n\t\tix += dx4;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every6d( x );\n* // returns true\n*/\nfunction every6d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 5 ];\n\t\tS1 = sh[ 4 ];\n\t\tS2 = sh[ 3 ];\n\t\tS3 = sh[ 2 ];\n\t\tS4 = sh[ 1 ];\n\t\tS5 = sh[ 0 ];\n\t\tdx0 = sx[ 5 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 4 ] - ( S0*sx[5] );\n\t\tdx2 = sx[ 3 ] - ( S1*sx[4] );\n\t\tdx3 = sx[ 2 ] - ( S2*sx[3] );\n\t\tdx4 = sx[ 1 ] - ( S3*sx[2] );\n\t\tdx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t\tix += dx3;\n\t\t\t}\n\t\t\tix += dx4;\n\t\t}\n\t\tix += dx5;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every7d( x );\n* // returns true\n*/\nfunction every7d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 6 ];\n\t\tS1 = sh[ 5 ];\n\t\tS2 = sh[ 4 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 2 ];\n\t\tS5 = sh[ 1 ];\n\t\tS6 = sh[ 0 ];\n\t\tdx0 = sx[ 6 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 5 ] - ( S0*sx[6] );\n\t\tdx2 = sx[ 4 ] - ( S1*sx[5] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[4] );\n\t\tdx4 = sx[ 2 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 1 ] - ( S4*sx[2] );\n\t\tdx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx3;\n\t\t\t\t}\n\t\t\t\tix += dx4;\n\t\t\t}\n\t\t\tix += dx5;\n\t\t}\n\t\tix += dx6;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every8d( x );\n* // returns true\n*/\nfunction every8d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 7 ];\n\t\tS1 = sh[ 6 ];\n\t\tS2 = sh[ 5 ];\n\t\tS3 = sh[ 4 ];\n\t\tS4 = sh[ 3 ];\n\t\tS5 = sh[ 2 ];\n\t\tS6 = sh[ 1 ];\n\t\tS7 = sh[ 0 ];\n\t\tdx0 = sx[ 7 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 6 ] - ( S0*sx[7] );\n\t\tdx2 = sx[ 5 ] - ( S1*sx[6] );\n\t\tdx3 = sx[ 4 ] - ( S2*sx[5] );\n\t\tdx4 = sx[ 3 ] - ( S3*sx[4] );\n\t\tdx5 = sx[ 2 ] - ( S4*sx[3] );\n\t\tdx6 = sx[ 1 ] - ( S5*sx[2] );\n\t\tdx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx4;\n\t\t\t\t}\n\t\t\t\tix += dx5;\n\t\t\t}\n\t\t\tix += dx6;\n\t\t}\n\t\tix += dx7;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every9d( x );\n* // returns true\n*/\nfunction every9d( x ) {\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 8 ];\n\t\tS1 = sh[ 7 ];\n\t\tS2 = sh[ 6 ];\n\t\tS3 = sh[ 5 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 3 ];\n\t\tS6 = sh[ 2 ];\n\t\tS7 = sh[ 1 ];\n\t\tS8 = sh[ 0 ];\n\t\tdx0 = sx[ 8 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 7 ] - ( S0*sx[8] );\n\t\tdx2 = sx[ 6 ] - ( S1*sx[7] );\n\t\tdx3 = sx[ 5 ] - ( S2*sx[6] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[5] );\n\t\tdx5 = sx[ 3 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 2 ] - ( S5*sx[3] );\n\t\tdx7 = sx[ 1 ] - ( S6*sx[2] );\n\t\tdx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx5;\n\t\t\t\t}\n\t\t\t\tix += dx6;\n\t\t\t}\n\t\t\tix += dx7;\n\t\t}\n\t\tix += dx8;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = every10d( x );\n* // returns true\n*/\nfunction every10d( x ) { // eslint-disable-line max-statements\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar sh;\n\tvar S0;\n\tvar S1;\n\tvar S2;\n\tvar S3;\n\tvar S4;\n\tvar S5;\n\tvar S6;\n\tvar S7;\n\tvar S8;\n\tvar S9;\n\tvar sx;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\n\t// Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...\n\tsh = x.shape;\n\tsx = x.strides;\n\tif ( strides2order( sx ) === 1 ) {\n\t\t// For row-major ndarrays, the last dimensions have the fastest changing indices...\n\t\tS0 = sh[ 9 ];\n\t\tS1 = sh[ 8 ];\n\t\tS2 = sh[ 7 ];\n\t\tS3 = sh[ 6 ];\n\t\tS4 = sh[ 5 ];\n\t\tS5 = sh[ 4 ];\n\t\tS6 = sh[ 3 ];\n\t\tS7 = sh[ 2 ];\n\t\tS8 = sh[ 1 ];\n\t\tS9 = sh[ 0 ];\n\t\tdx0 = sx[ 9 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 8 ] - ( S0*sx[9] );\n\t\tdx2 = sx[ 7 ] - ( S1*sx[8] );\n\t\tdx3 = sx[ 6 ] - ( S2*sx[7] );\n\t\tdx4 = sx[ 5 ] - ( S3*sx[6] );\n\t\tdx5 = sx[ 4 ] - ( S4*sx[5] );\n\t\tdx6 = sx[ 3 ] - ( S5*sx[4] );\n\t\tdx7 = sx[ 2 ] - ( S6*sx[3] );\n\t\tdx8 = sx[ 1 ] - ( S7*sx[2] );\n\t\tdx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop\n\t} else { // order === 'column-major'\n\t\t// For column-major ndarrays, the first dimensions have the fastest changing indices...\n\t\tS0 = sh[ 0 ];\n\t\tS1 = sh[ 1 ];\n\t\tS2 = sh[ 2 ];\n\t\tS3 = sh[ 3 ];\n\t\tS4 = sh[ 4 ];\n\t\tS5 = sh[ 5 ];\n\t\tS6 = sh[ 6 ];\n\t\tS7 = sh[ 7 ];\n\t\tS8 = sh[ 8 ];\n\t\tS9 = sh[ 9 ];\n\t\tdx0 = sx[ 0 ]; // offset increment for innermost loop\n\t\tdx1 = sx[ 1 ] - ( S0*sx[0] );\n\t\tdx2 = sx[ 2 ] - ( S1*sx[1] );\n\t\tdx3 = sx[ 3 ] - ( S2*sx[2] );\n\t\tdx4 = sx[ 4 ] - ( S3*sx[3] );\n\t\tdx5 = sx[ 5 ] - ( S4*sx[4] );\n\t\tdx6 = sx[ 6 ] - ( S5*sx[5] );\n\t\tdx7 = sx[ 7 ] - ( S6*sx[6] );\n\t\tdx8 = sx[ 8 ] - ( S7*sx[7] );\n\t\tdx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop\n\t}\n\t// Set a pointer to the first indexed element:\n\tix = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Iterate over the ndarray dimensions...\n\tfor ( i9 = 0; i9 < S9; i9++ ) {\n\t\tfor ( i8 = 0; i8 < S8; i8++ ) {\n\t\t\tfor ( i7 = 0; i7 < S7; i7++ ) {\n\t\t\t\tfor ( i6 = 0; i6 < S6; i6++ ) {\n\t\t\t\t\tfor ( i5 = 0; i5 < S5; i5++ ) {\n\t\t\t\t\t\tfor ( i4 = 0; i4 < S4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < S3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < S2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < S1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < S0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx6;\n\t\t\t\t}\n\t\t\t\tix += dx7;\n\t\t\t}\n\t\t\tix += dx8;\n\t\t}\n\t\tix += dx9;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default every10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ];\n*\n* // Define the index offset:\n* var ox = 1;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'float64',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !xbuf[ ix ] ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element in an ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @param {Array} x.accessors - data buffer accessors\n* @returns {boolean} result\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import accessors from '@stdlib/array-base-accessors';\n*\n* // Create a data buffer:\n* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'generic',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major',\n* 'accessors': accessors( xbuf ).accessors\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar get;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Cache accessor:\n\tget = x.accessors[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !get( xbuf, ix ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery2d( x );\n* // returns true\n*/\nfunction blockedevery2d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar ox1;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar j0;\n\tvar j1;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\tif ( j1 < bsize ) {\n\t\t\ts1 = j1;\n\t\t\tj1 = 0;\n\t\t} else {\n\t\t\ts1 = bsize;\n\t\t\tj1 -= bsize;\n\t\t}\n\t\tox1 = ox + ( j1*sx[1] );\n\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\tif ( j0 < bsize ) {\n\t\t\t\ts0 = j0;\n\t\t\t\tj0 = 0;\n\t\t\t} else {\n\t\t\t\ts0 = bsize;\n\t\t\t\tj0 -= bsize;\n\t\t\t}\n\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t// Compute the loop offset increment:\n\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t// Iterate over the ndarray dimensions...\n\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx0;\n\t\t\t\t}\n\t\t\t\tix += dx1;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery2d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery3d( x );\n* // returns true\n*/\nfunction blockedevery3d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar ox1;\n\tvar ox2;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\tif ( j2 < bsize ) {\n\t\t\ts2 = j2;\n\t\t\tj2 = 0;\n\t\t} else {\n\t\t\ts2 = bsize;\n\t\t\tj2 -= bsize;\n\t\t}\n\t\tox2 = ox + ( j2*sx[2] );\n\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\tif ( j1 < bsize ) {\n\t\t\t\ts1 = j1;\n\t\t\t\tj1 = 0;\n\t\t\t} else {\n\t\t\t\ts1 = bsize;\n\t\t\t\tj1 -= bsize;\n\t\t\t}\n\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\ts0 = j0;\n\t\t\t\t\tj0 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts0 = bsize;\n\t\t\t\t\tj0 -= bsize;\n\t\t\t\t}\n\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t// Compute the loop offset increment:\n\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t}\n\t\t\t\t\tix += dx2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery3d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery4d( x );\n* // returns true\n*/\nfunction blockedevery4d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\tif ( j3 < bsize ) {\n\t\t\ts3 = j3;\n\t\t\tj3 = 0;\n\t\t} else {\n\t\t\ts3 = bsize;\n\t\t\tj3 -= bsize;\n\t\t}\n\t\tox3 = ox + ( j3*sx[3] );\n\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\tif ( j2 < bsize ) {\n\t\t\t\ts2 = j2;\n\t\t\t\tj2 = 0;\n\t\t\t} else {\n\t\t\t\ts2 = bsize;\n\t\t\t\tj2 -= bsize;\n\t\t\t}\n\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\ts1 = j1;\n\t\t\t\t\tj1 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts1 = bsize;\n\t\t\t\t\tj1 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery4d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery5d( x );\n* // returns true\n*/\nfunction blockedevery5d( x ) {\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\tif ( j4 < bsize ) {\n\t\t\ts4 = j4;\n\t\t\tj4 = 0;\n\t\t} else {\n\t\t\ts4 = bsize;\n\t\t\tj4 -= bsize;\n\t\t}\n\t\tox4 = ox + ( j4*sx[4] );\n\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\tif ( j3 < bsize ) {\n\t\t\t\ts3 = j3;\n\t\t\t\tj3 = 0;\n\t\t\t} else {\n\t\t\t\ts3 = bsize;\n\t\t\t\tj3 -= bsize;\n\t\t\t}\n\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\ts2 = j2;\n\t\t\t\t\tj2 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts2 = bsize;\n\t\t\t\t\tj2 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery5d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery6d( x );\n* // returns true\n*/\nfunction blockedevery6d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\tif ( j5 < bsize ) {\n\t\t\ts5 = j5;\n\t\t\tj5 = 0;\n\t\t} else {\n\t\t\ts5 = bsize;\n\t\t\tj5 -= bsize;\n\t\t}\n\t\tox5 = ox + ( j5*sx[5] );\n\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\tif ( j4 < bsize ) {\n\t\t\t\ts4 = j4;\n\t\t\t\tj4 = 0;\n\t\t\t} else {\n\t\t\t\ts4 = bsize;\n\t\t\t\tj4 -= bsize;\n\t\t\t}\n\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\ts3 = j3;\n\t\t\t\t\tj3 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts3 = bsize;\n\t\t\t\t\tj3 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery6d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery7d( x );\n* // returns true\n*/\nfunction blockedevery7d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\tif ( j6 < bsize ) {\n\t\t\ts6 = j6;\n\t\t\tj6 = 0;\n\t\t} else {\n\t\t\ts6 = bsize;\n\t\t\tj6 -= bsize;\n\t\t}\n\t\tox6 = ox + ( j6*sx[6] );\n\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\tif ( j5 < bsize ) {\n\t\t\t\ts5 = j5;\n\t\t\t\tj5 = 0;\n\t\t\t} else {\n\t\t\t\ts5 = bsize;\n\t\t\t\tj5 -= bsize;\n\t\t\t}\n\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\ts4 = j4;\n\t\t\t\t\tj4 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts4 = bsize;\n\t\t\t\t\tj4 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery7d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery8d( x );\n* // returns true\n*/\nfunction blockedevery8d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\tif ( j7 < bsize ) {\n\t\t\ts7 = j7;\n\t\t\tj7 = 0;\n\t\t} else {\n\t\t\ts7 = bsize;\n\t\t\tj7 -= bsize;\n\t\t}\n\t\tox7 = ox + ( j7*sx[7] );\n\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\tif ( j6 < bsize ) {\n\t\t\t\ts6 = j6;\n\t\t\t\tj6 = 0;\n\t\t\t} else {\n\t\t\t\ts6 = bsize;\n\t\t\t\tj6 -= bsize;\n\t\t\t}\n\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\ts5 = j5;\n\t\t\t\t\tj5 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts5 = bsize;\n\t\t\t\t\tj5 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery8d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery9d( x );\n* // returns true\n*/\nfunction blockedevery9d( x ) { // eslint-disable-line max-statements\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\tif ( j8 < bsize ) {\n\t\t\ts8 = j8;\n\t\t\tj8 = 0;\n\t\t} else {\n\t\t\ts8 = bsize;\n\t\t\tj8 -= bsize;\n\t\t}\n\t\tox8 = ox + ( j8*sx[8] );\n\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\tif ( j7 < bsize ) {\n\t\t\t\ts7 = j7;\n\t\t\t\tj7 = 0;\n\t\t\t} else {\n\t\t\t\ts7 = bsize;\n\t\t\t\tj7 -= bsize;\n\t\t\t}\n\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\ts6 = j6;\n\t\t\t\t\tj6 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts6 = bsize;\n\t\t\t\t\tj6 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery9d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-depth, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport loopOrder from '@stdlib/ndarray-base-nullary-loop-interchange-order';\nimport blockSize from '@stdlib/ndarray-base-nullary-tiling-block-size';\n\n\n// MAIN //\n\n/**\n* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking.\n*\n* @private\n* @param {Object} x - object containing ndarray meta data\n* @param {string} x.dtype - data type\n* @param {Collection} x.data - data buffer\n* @param {NonNegativeIntegerArray} x.shape - dimensions\n* @param {IntegerArray} x.strides - stride lengths\n* @param {NonNegativeInteger} x.offset - index offset\n* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style)\n* @returns {boolean} result\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* // Create a data buffer:\n* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );\n*\n* // Define the shape of the input array:\n* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ];\n*\n* // Define the array strides:\n* var sx = [ 8, 8, 8, 8, 8, 8, 8, 8, 4, 2 ];\n*\n* // Define the index offset:\n* var ox = 0;\n*\n* // Create the input ndarray-like object:\n* var x = {\n* 'dtype': 'complex128',\n* 'data': xbuf,\n* 'shape': shape,\n* 'strides': sx,\n* 'offset': ox,\n* 'order': 'row-major'\n* };\n*\n* // Test elements:\n* var out = blockedevery10d( x );\n* // returns true\n*/\nfunction blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function\n\tvar bsize;\n\tvar xbuf;\n\tvar dx0;\n\tvar dx1;\n\tvar dx2;\n\tvar dx3;\n\tvar dx4;\n\tvar dx5;\n\tvar dx6;\n\tvar dx7;\n\tvar dx8;\n\tvar dx9;\n\tvar ox1;\n\tvar ox2;\n\tvar ox3;\n\tvar ox4;\n\tvar ox5;\n\tvar ox6;\n\tvar ox7;\n\tvar ox8;\n\tvar ox9;\n\tvar sh;\n\tvar s0;\n\tvar s1;\n\tvar s2;\n\tvar s3;\n\tvar s4;\n\tvar s5;\n\tvar s6;\n\tvar s7;\n\tvar s8;\n\tvar s9;\n\tvar sx;\n\tvar ox;\n\tvar ix;\n\tvar i0;\n\tvar i1;\n\tvar i2;\n\tvar i3;\n\tvar i4;\n\tvar i5;\n\tvar i6;\n\tvar i7;\n\tvar i8;\n\tvar i9;\n\tvar j0;\n\tvar j1;\n\tvar j2;\n\tvar j3;\n\tvar j4;\n\tvar j5;\n\tvar j6;\n\tvar j7;\n\tvar j8;\n\tvar j9;\n\tvar o;\n\n\t// Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop...\n\n\t// Resolve the loop interchange order:\n\to = loopOrder( x.shape, x.strides );\n\tsh = o.sh;\n\tsx = o.sx;\n\n\t// Determine the block size:\n\tbsize = blockSize( x.dtype );\n\n\t// Set a pointer to the first indexed element:\n\tox = x.offset;\n\n\t// Cache a reference to the input ndarray buffer:\n\txbuf = x.data;\n\n\t// Cache the offset increment for the innermost loop:\n\tdx0 = sx[0];\n\n\t// Iterate over blocks...\n\tfor ( j9 = sh[9]; j9 > 0; ) {\n\t\tif ( j9 < bsize ) {\n\t\t\ts9 = j9;\n\t\t\tj9 = 0;\n\t\t} else {\n\t\t\ts9 = bsize;\n\t\t\tj9 -= bsize;\n\t\t}\n\t\tox9 = ox + ( j9*sx[9] );\n\t\tfor ( j8 = sh[8]; j8 > 0; ) {\n\t\t\tif ( j8 < bsize ) {\n\t\t\t\ts8 = j8;\n\t\t\t\tj8 = 0;\n\t\t\t} else {\n\t\t\t\ts8 = bsize;\n\t\t\t\tj8 -= bsize;\n\t\t\t}\n\t\t\tdx9 = sx[9] - ( s8*sx[8] );\n\t\t\tox8 = ox9 + ( j8*sx[8] );\n\t\t\tfor ( j7 = sh[7]; j7 > 0; ) {\n\t\t\t\tif ( j7 < bsize ) {\n\t\t\t\t\ts7 = j7;\n\t\t\t\t\tj7 = 0;\n\t\t\t\t} else {\n\t\t\t\t\ts7 = bsize;\n\t\t\t\t\tj7 -= bsize;\n\t\t\t\t}\n\t\t\t\tdx8 = sx[8] - ( s7*sx[7] );\n\t\t\t\tox7 = ox8 + ( j7*sx[7] );\n\t\t\t\tfor ( j6 = sh[6]; j6 > 0; ) {\n\t\t\t\t\tif ( j6 < bsize ) {\n\t\t\t\t\t\ts6 = j6;\n\t\t\t\t\t\tj6 = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts6 = bsize;\n\t\t\t\t\t\tj6 -= bsize;\n\t\t\t\t\t}\n\t\t\t\t\tdx7 = sx[7] - ( s6*sx[6] );\n\t\t\t\t\tox6 = ox7 + ( j6*sx[6] );\n\t\t\t\t\tfor ( j5 = sh[5]; j5 > 0; ) {\n\t\t\t\t\t\tif ( j5 < bsize ) {\n\t\t\t\t\t\t\ts5 = j5;\n\t\t\t\t\t\t\tj5 = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ts5 = bsize;\n\t\t\t\t\t\t\tj5 -= bsize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdx6 = sx[6] - ( s5*sx[5] );\n\t\t\t\t\t\tox5 = ox6 + ( j5*sx[5] );\n\t\t\t\t\t\tfor ( j4 = sh[4]; j4 > 0; ) {\n\t\t\t\t\t\t\tif ( j4 < bsize ) {\n\t\t\t\t\t\t\t\ts4 = j4;\n\t\t\t\t\t\t\t\tj4 = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ts4 = bsize;\n\t\t\t\t\t\t\t\tj4 -= bsize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdx5 = sx[5] - ( s4*sx[4] );\n\t\t\t\t\t\t\tox4 = ox5 + ( j4*sx[4] );\n\t\t\t\t\t\t\tfor ( j3 = sh[3]; j3 > 0; ) {\n\t\t\t\t\t\t\t\tif ( j3 < bsize ) {\n\t\t\t\t\t\t\t\t\ts3 = j3;\n\t\t\t\t\t\t\t\t\tj3 = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ts3 = bsize;\n\t\t\t\t\t\t\t\t\tj3 -= bsize;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdx4 = sx[4] - ( s3*sx[3] );\n\t\t\t\t\t\t\t\tox3 = ox4 + ( j3*sx[3] );\n\t\t\t\t\t\t\t\tfor ( j2 = sh[2]; j2 > 0; ) {\n\t\t\t\t\t\t\t\t\tif ( j2 < bsize ) {\n\t\t\t\t\t\t\t\t\t\ts2 = j2;\n\t\t\t\t\t\t\t\t\t\tj2 = 0;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts2 = bsize;\n\t\t\t\t\t\t\t\t\t\tj2 -= bsize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdx3 = sx[3] - ( s2*sx[2] );\n\t\t\t\t\t\t\t\t\tox2 = ox3 + ( j2*sx[2] );\n\t\t\t\t\t\t\t\t\tfor ( j1 = sh[1]; j1 > 0; ) {\n\t\t\t\t\t\t\t\t\t\tif ( j1 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\ts1 = j1;\n\t\t\t\t\t\t\t\t\t\t\tj1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ts1 = bsize;\n\t\t\t\t\t\t\t\t\t\t\tj1 -= bsize;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdx2 = sx[2] - ( s1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tox1 = ox2 + ( j1*sx[1] );\n\t\t\t\t\t\t\t\t\t\tfor ( j0 = sh[0]; j0 > 0; ) {\n\t\t\t\t\t\t\t\t\t\t\tif ( j0 < bsize ) {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = j0;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 = 0;\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ts0 = bsize;\n\t\t\t\t\t\t\t\t\t\t\t\tj0 -= bsize;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// Compute the index offset for the first input ndarray element in the current block:\n\t\t\t\t\t\t\t\t\t\t\tix = ox1 + ( j0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Compute the loop offset increment:\n\t\t\t\t\t\t\t\t\t\t\tdx1 = sx[1] - ( s0*sx[0] );\n\n\t\t\t\t\t\t\t\t\t\t\t// Iterate over the ndarray dimensions...\n\t\t\t\t\t\t\t\t\t\t\tfor ( i9 = 0; i9 < s9; i9++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor ( i8 = 0; i8 < s8; i8++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i7 = 0; i7 < s7; i7++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i6 = 0; i6 < s6; i6++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i5 = 0; i5 < s5; i5++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i4 = 0; i4 < s4; i4++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i3 = 0; i3 < s3; i3++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i2 = 0; i2 < s2; i2++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i1 = 0; i1 < s1; i1++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ( i0 = 0; i0 < s0; i0++ ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx3;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx4;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx6;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx7;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tix += dx8;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tix += dx9;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default blockedevery10d;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `BooleanArray` as a `Uint8Array`.\n*\n* @param {BooleanArray} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Uint8Array} `Uint8Array` view\n*\n* @example\n* import BooleanArray from '@stdlib/array-bool';\n*\n* var x = new BooleanArray( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Uint8Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Reinterprets a complex-valued floating-point array as a real-valued floating-point array having the same precision.\n*\n* @param {(Complex128Array|Complex64Array)} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @throws {TypeError} first argument must be a supported complex-valued floating-point array\n* @returns {(Float64Array|Float32Array)} real-valued floating-point array view\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\tif ( isComplex128Array( x ) ) {\n\t\treturn reinterpret128( x, offset );\n\t}\n\tif ( isComplex64Array( x ) ) {\n\t\treturn reinterpret64( x, offset );\n\t}\n\t// Note: intentionally throw here to catch the scenario in which we add, e.g., a Complex32Array and need to explicitly add support here...\n\tthrow new TypeError( format( 'invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns array iteration order.\n*\n* ## Notes\n*\n* - Return value key:\n*\n* - `0`: unordered (i.e., strides of mixed sign; e.g., `[ 9, -3, 1 ]`)\n* - `1`: ordered left-to-right (i.e., all nonnegative strides)\n* - `-1`: ordered right-to-left (i.e., all negative strides)\n*\n* @param {IntegerArray} strides - stride array\n* @returns {integer} iteration order\n*\n* @example\n* var o = iterationOrder( [ 2, 1 ] );\n* // returns 1\n*\n* o = iterationOrder( [ -2, 1 ] );\n* // returns 0\n*\n* o = iterationOrder( [ -2, -1 ] );\n* // returns -1\n*/\nfunction iterationOrder( strides ) {\n\tvar cnt;\n\tvar i;\n\n\tcnt = 0;\n\tfor ( i = 0; i < strides.length; i++ ) {\n\t\tif ( strides[ i ] < 0 ) {\n\t\t\tcnt += 1;\n\t\t}\n\t}\n\tif ( cnt === 0 ) {\n\t\t// All nonnegative strides:\n\t\treturn 1|0; // asm-type annotation\n\t}\n\tif ( cnt === strides.length ) {\n\t\t// All negative strides:\n\t\treturn -1|0; // asm-type annotation\n\t}\n\t// Strides of mixed signs:\n\treturn 0|0; // asm-type annotation\n}\n\n\n// EXPORTS //\n\nexport default iterationOrder;\n"],"names":["C64_BYTES_PER_ELEMENT","C128_BYTES_PER_ELEMENT","BYTES_PER_ELEMENT","main","Object","defineProperty","isNumber","value","zeros","n","i","out","zeroPad","str","width","right","negative","pad","length","startsWithMinus","substr","lowercase","String","prototype","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","toString","precision","padRight","sign","alternate","call","charAt","abs","Math","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","f","digits","toExponential","toFixed","toPrecision","spaces","fromCharCode","isArray","Array","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","parseFloat","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","push","format","args","tokenize","interpolate","apply","objectProtoype","toStr","defineGetter","__defineGetter__","defineSetter","__defineSetter__","lookupGetter","__lookupGetter__","lookupSetter","__lookupSetter__","err","hasDefinePropertySupport","builtin","obj","prop","descriptor","hasValue","hasGet","hasSet","__proto__","get","set","defineProperty$1","setNonEnumerableReadOnly","configurable","enumerable","writable","minmaxViewBufferIndex","shape","strides","offset","ndims","min","max","s","setReadOnly","TYPE","isAccessorArray","GETTERS","complex128","arr","idx","complex64","default","getter","dtype","SETTERS","setter","float64","float32","int32","int16","int8","uint32","uint16","uint8","uint8c","generic","numel","copy","x","len","isString","FLG","Symbol","hasToStringTagSupport","toStringTag","has","hasOwnProperty","hasOwnProp","property","Sym","toStrTag","nativeClass","hasToStringTag","v","isOwn","tag","valueOf","test","isPrimitive","isObject","isColumnMajorString","shape2strides","order","isColumnMajor","columnmajor","rowmajor","ROW_MAJOR","ord","sh","st","copyIndexed","main$c","Number","o","strides2offset","strides2order","column","row","s1","s2","COLUMN_MAJOR","ndarraylike2object","xbuf","bool","dt","data","getData","getShape","getDType","ref","getStrides","getOffset","getOrder","accessorProtocol","accessors","accessorGetter","accessorSetter","isComplex128Array","constructor","name","isComplex64Array","hasFloat64Array","Float64Array","ctor","GlobalFloat64Array","NaN","hasFloat64ArraySupport","Float64Array$1","reinterpret","buffer","byteOffset","hasFloat32Array","Float32Array","FLOAT64_PINF","POSITIVE_INFINITY","GlobalFloat32Array","PINF","hasFloat32ArraySupport","Float32Array$1","hasUint8Array","Uint8Array","GlobalUint8Array","UINT8_MAX","hasUint8ArraySupport","Uint8Array$1","main$8","arrayfcn","predicate","isObjectLike","isBuffer","_isBuffer","reFunctionName","arrayfun","RE_FUNCTION_NAME","constructorName","REGEXP","ctor2dtypes","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8ClampedArray","Complex64Array","Complex128Array","BooleanArray","hasUint32Array","UINT32_MAX","GlobalUint32Array","hasUint32ArraySupport","Uint32Array$1","hasInt32Array","GlobalInt32Array","INT32_MAX","hasInt32ArraySupport","Int32Array$1","hasUint16Array","GlobalUint16Array","UINT16_MAX","hasUint16ArraySupport","Uint16Array$1","hasInt16Array","GlobalInt16Array","INT16_MAX","hasInt16ArraySupport","Int16Array$1","hasUint8ClampedArray","GlobalUint8ClampedArray","hasUint8ClampedArraySupport","Uint8ClampedArray$1","hasInt8Array","GlobalInt8Array","INT8_MAX","hasInt8ArraySupport","Int8Array$1","FLOAT64_NINF","NEGATIVE_INFINITY","floor","isInteger","NINF","isInt","isNonNegativeInteger","MAX_ARRAY_LENGTH","isArrayLikeObject","MAX_LENGTH","MAX_TYPED_ARRAY_LENGTH","isCollection","hasArrayBuffer","ArrayBuffer","isArrayBuffer","isPrimitiveArray","isObjectArray","isStringArray","isBoolean","Bool","Boolean","self","window","global","globalThis","root","codegen","Function","GlobalThis","Self","Win","Global","getGlobal","nodeList","document","childNodes","typedarray","ctorName","type","isFunction","typeOf","Complex128","real","imag","this","setEnumerableReadOnly","re","im","fround","FLOAT32_VIEW","float64ToFloat32$1","Complex64","float64ToFloat32","isComplexLike","isEven","hasIteratorSymbolSupport","iterator","IteratorSymbol","setNonEnumerableReadOnlyAccessor","z","fromIterator","it","next","done","realf","imagf","HAS_ITERATOR_SYMBOL","isComplexArray","_length","_buffer","isComplexArrayConstructor","getComplex64","buf","nargs","fromArray","RangeError","reinterpret64","reinterpret128","byteLength","ITERATOR_SYMBOL","src","thisArg","clbk","tmp","flg","fromIteratorMap","target","start","copyWithin","iter","entries","end","fcn","searchElement","fromIndex","separator","sep","join","keys","outbuf","reducer","initialValue","acc","N","sbuf","outlen","compareFcn","sort","begin","locales","options","opts","loc","toLocaleString","values","index","getComplex128","isBooleanArray","isBooleanArrayConstructor","val","a","b","CTORS","DTYPES","NTYPES","arraylike2object","ctor2dtype","M","gscal","alpha","stride","ix","m","xget","xset","ndarray","stride2offset","zeroTo","complex","loopOrder","sx","y","avx","iy","jx","jy","vx","vy","ux","sort2ins","indices","take","isPositiveInteger","indexed","isArguments","bool$6","detect","hasArgumentsClass","isNan","isEnumerableProperty","propertyIsEnumerable","hasStringEnumBug","isEnum","isArguments$1","isConstructorPrototype","w","hasAutomationEqualityBug","k","win","EXCLUDED_KEYS","check","HAS_BUILTIN","skipConstructor","skipPrototype","isFcn","p","HAS_ENUM_PROTO_BUG","HAS_NON_ENUM_PROPS_BUG","HAS_WINDOW","error","NON_ENUMERABLE","getProto","Obj","getPrototypeOf","proto","getProto$1","objectPrototype","isPlainObject","isPrototypeOf","key","ownProps","hash","allowDupes","duplicates","objectKeys","objectInverse","int64","uint64","float16","complex32","binary","notype","userdefined_type","bytesPerElement","enum2str","defaults","BLOCK_SIZE_IN_BYTES","BLOCK_SIZE_IN_ELEMENTS","nullaryBlockSize","dtypeX","dtypes","nb","blockSize","vind2bind","mode","ind","MODE","EVERY","dx0","S0","i0","dx1","S1","i1","dx2","S2","i2","dx3","S3","i3","dx4","S4","i4","dx5","S5","i5","dx6","S6","i6","dx7","S7","i7","dx8","S8","i8","dx9","S9","i9","ACCESSOR_EVERY","COMPLEX_EVERY","BLOCKED_EVERY","bsize","ox1","s0","ox","j0","j1","ox2","j2","ox3","s3","j3","ox4","s4","j4","ox5","s5","j5","ox6","s6","j6","ox7","s7","j7","ox8","s8","j8","ox9","s9","j9","BLOCKED_ACCESSOR_EVERY","BLOCKED_COMPLEX_EVERY","MAX_DIMS","arrays","isCmplx","xmmv","shx","iox","ns","d","ndarray2object","reinterpretBoolean","reinterpretComplex","cnt","iterationOrder","ordx","accessoreverynd","complexeverynd","everynd"],"mappings":"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","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,338,339,340]} \ No newline at end of file diff --git a/lib/0d.js b/lib/0d.js deleted file mode 100644 index 797d896..0000000 --- a/lib/0d.js +++ /dev/null @@ -1,75 +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'; - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0 ] ); -* -* // Define the shape of the input array: -* var shape = []; -* -* // Define the array strides: -* var sx = [ 0 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every0d( x ); -* // returns true -*/ -function every0d( x ) { - if ( x.data[ x.offset ] ) { - return true; - } - return false; -} - - -// EXPORTS // - -module.exports = every0d; diff --git a/lib/0d_accessors.js b/lib/0d_accessors.js deleted file mode 100644 index 170c135..0000000 --- a/lib/0d_accessors.js +++ /dev/null @@ -1,78 +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'; - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0 ] ); -* -* // Define the shape of the input array: -* var shape = []; -* -* // Define the array strides: -* var sx = [ 0 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every0d( x ); -* // returns true -*/ -function every0d( x ) { - if ( x.accessors[ 0 ]( x.data, x.offset ) ) { - return true; - } - return false; -} - - -// EXPORTS // - -module.exports = every0d; diff --git a/lib/0d_complex.js b/lib/0d_complex.js deleted file mode 100644 index 7c653a9..0000000 --- a/lib/0d_complex.js +++ /dev/null @@ -1,75 +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'; - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0 ] ); -* -* // Define the shape of the input array: -* var shape = []; -* -* // Define the array strides: -* var sx = [ 0 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every0d( x ); -* // returns true -*/ -function every0d( x ) { - if ( x.data[ x.offset ] || x.data[ x.offset+1 ] ) { - return true; - } - return false; -} - - -// EXPORTS // - -module.exports = every0d; diff --git a/lib/10d.js b/lib/10d.js deleted file mode 100644 index 3f50462..0000000 --- a/lib/10d.js +++ /dev/null @@ -1,204 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every10d( x ); -* // returns true -*/ -function every10d( x ) { // eslint-disable-line max-statements - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var S9; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 9 ]; - S1 = sh[ 8 ]; - S2 = sh[ 7 ]; - S3 = sh[ 6 ]; - S4 = sh[ 5 ]; - S5 = sh[ 4 ]; - S6 = sh[ 3 ]; - S7 = sh[ 2 ]; - S8 = sh[ 1 ]; - S9 = sh[ 0 ]; - dx0 = sx[ 9 ]; // offset increment for innermost loop - dx1 = sx[ 8 ] - ( S0*sx[9] ); - dx2 = sx[ 7 ] - ( S1*sx[8] ); - dx3 = sx[ 6 ] - ( S2*sx[7] ); - dx4 = sx[ 5 ] - ( S3*sx[6] ); - dx5 = sx[ 4 ] - ( S4*sx[5] ); - dx6 = sx[ 3 ] - ( S5*sx[4] ); - dx7 = sx[ 2 ] - ( S6*sx[3] ); - dx8 = sx[ 1 ] - ( S7*sx[2] ); - dx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - S9 = sh[ 9 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); - dx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < S9; i9++ ) { - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - return true; -} - - -// EXPORTS // - -module.exports = every10d; diff --git a/lib/10d_accessors.js b/lib/10d_accessors.js deleted file mode 100644 index 83816e3..0000000 --- a/lib/10d_accessors.js +++ /dev/null @@ -1,211 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every10d( x ); -* // returns true -*/ -function every10d( x ) { // eslint-disable-line max-statements - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var S9; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 9 ]; - S1 = sh[ 8 ]; - S2 = sh[ 7 ]; - S3 = sh[ 6 ]; - S4 = sh[ 5 ]; - S5 = sh[ 4 ]; - S6 = sh[ 3 ]; - S7 = sh[ 2 ]; - S8 = sh[ 1 ]; - S9 = sh[ 0 ]; - dx0 = sx[ 9 ]; // offset increment for innermost loop - dx1 = sx[ 8 ] - ( S0*sx[9] ); - dx2 = sx[ 7 ] - ( S1*sx[8] ); - dx3 = sx[ 6 ] - ( S2*sx[7] ); - dx4 = sx[ 5 ] - ( S3*sx[6] ); - dx5 = sx[ 4 ] - ( S4*sx[5] ); - dx6 = sx[ 3 ] - ( S5*sx[4] ); - dx7 = sx[ 2 ] - ( S6*sx[3] ); - dx8 = sx[ 1 ] - ( S7*sx[2] ); - dx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - S9 = sh[ 9 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); - dx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < S9; i9++ ) { - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - return true; -} - - -// EXPORTS // - -module.exports = every10d; diff --git a/lib/10d_blocked.js b/lib/10d_blocked.js deleted file mode 100644 index 61173d4..0000000 --- a/lib/10d_blocked.js +++ /dev/null @@ -1,304 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery10d( x ); -* // returns true -*/ -function blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var ox9; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var s8; - var s9; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var j9; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j9 = sh[9]; j9 > 0; ) { - if ( j9 < bsize ) { - s9 = j9; - j9 = 0; - } else { - s9 = bsize; - j9 -= bsize; - } - ox9 = ox + ( j9*sx[9] ); - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - s8 = j8; - j8 = 0; - } else { - s8 = bsize; - j8 -= bsize; - } - dx9 = sx[9] - ( s8*sx[8] ); - ox8 = ox9 + ( j8*sx[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( s7*sx[7] ); - ox7 = ox8 + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < s9; i9++ ) { - for ( i8 = 0; i8 < s8; i8++ ) { - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - } - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery10d; diff --git a/lib/10d_blocked_accessors.js b/lib/10d_blocked_accessors.js deleted file mode 100644 index b65c9bd..0000000 --- a/lib/10d_blocked_accessors.js +++ /dev/null @@ -1,311 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery10d( x ); -* // returns true -*/ -function blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var ox9; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var s8; - var s9; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var j9; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j9 = sh[9]; j9 > 0; ) { - if ( j9 < bsize ) { - s9 = j9; - j9 = 0; - } else { - s9 = bsize; - j9 -= bsize; - } - ox9 = ox + ( j9*sx[9] ); - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - s8 = j8; - j8 = 0; - } else { - s8 = bsize; - j8 -= bsize; - } - dx9 = sx[9] - ( s8*sx[8] ); - ox8 = ox9 + ( j8*sx[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( s7*sx[7] ); - ox7 = ox8 + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < s9; i9++ ) { - for ( i8 = 0; i8 < s8; i8++ ) { - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - } - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery10d; diff --git a/lib/10d_blocked_complex.js b/lib/10d_blocked_complex.js deleted file mode 100644 index dc50c13..0000000 --- a/lib/10d_blocked_complex.js +++ /dev/null @@ -1,304 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery10d( x ); -* // returns true -*/ -function blockedevery10d( x ) { // eslint-disable-line max-statements, max-lines-per-function - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var ox9; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var s8; - var s9; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var j9; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j9 = sh[9]; j9 > 0; ) { - if ( j9 < bsize ) { - s9 = j9; - j9 = 0; - } else { - s9 = bsize; - j9 -= bsize; - } - ox9 = ox + ( j9*sx[9] ); - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - s8 = j8; - j8 = 0; - } else { - s8 = bsize; - j8 -= bsize; - } - dx9 = sx[9] - ( s8*sx[8] ); - ox8 = ox9 + ( j8*sx[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( s7*sx[7] ); - ox7 = ox8 + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < s9; i9++ ) { - for ( i8 = 0; i8 < s8; i8++ ) { - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - } - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery10d; diff --git a/lib/10d_complex.js b/lib/10d_complex.js deleted file mode 100644 index 09fd1ef..0000000 --- a/lib/10d_complex.js +++ /dev/null @@ -1,204 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every10d( x ); -* // returns true -*/ -function every10d( x ) { // eslint-disable-line max-statements - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var dx9; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var S9; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var i9; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 9 ]; - S1 = sh[ 8 ]; - S2 = sh[ 7 ]; - S3 = sh[ 6 ]; - S4 = sh[ 5 ]; - S5 = sh[ 4 ]; - S6 = sh[ 3 ]; - S7 = sh[ 2 ]; - S8 = sh[ 1 ]; - S9 = sh[ 0 ]; - dx0 = sx[ 9 ]; // offset increment for innermost loop - dx1 = sx[ 8 ] - ( S0*sx[9] ); - dx2 = sx[ 7 ] - ( S1*sx[8] ); - dx3 = sx[ 6 ] - ( S2*sx[7] ); - dx4 = sx[ 5 ] - ( S3*sx[6] ); - dx5 = sx[ 4 ] - ( S4*sx[5] ); - dx6 = sx[ 3 ] - ( S5*sx[4] ); - dx7 = sx[ 2 ] - ( S6*sx[3] ); - dx8 = sx[ 1 ] - ( S7*sx[2] ); - dx9 = sx[ 0 ] - ( S8*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - S9 = sh[ 9 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); - dx9 = sx[ 9 ] - ( S8*sx[8] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i9 = 0; i9 < S9; i9++ ) { - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - ix += dx9; - } - return true; -} - - -// EXPORTS // - -module.exports = every10d; diff --git a/lib/1d.js b/lib/1d.js deleted file mode 100644 index 59f038f..0000000 --- a/lib/1d.js +++ /dev/null @@ -1,97 +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'; - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 4 ]; -* -* // Define the array strides: -* var sx = [ 2 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every1d( x ); -* // returns true -*/ -function every1d( x ) { - var xbuf; - var dx0; - var S0; - var ix; - var i0; - - // Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables: dimensions and loop offset (pointer) increments: - S0 = x.shape[ 0 ]; - dx0 = x.strides[ 0 ]; - - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - return true; -} - - -// EXPORTS // - -module.exports = every1d; diff --git a/lib/1d_accessors.js b/lib/1d_accessors.js deleted file mode 100644 index e22257a..0000000 --- a/lib/1d_accessors.js +++ /dev/null @@ -1,104 +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'; - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 4 ]; -* -* // Define the array strides: -* var sx = [ 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every1d( x ); -* // returns true -*/ -function every1d( x ) { - var xbuf; - var get; - var dx0; - var S0; - var ix; - var i0; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables: dimensions and loop offset (pointer) increments... - S0 = x.shape[ 0 ]; - dx0 = x.strides[ 0 ]; - - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - return true; -} - - -// EXPORTS // - -module.exports = every1d; diff --git a/lib/1d_complex.js b/lib/1d_complex.js deleted file mode 100644 index 0bdf508..0000000 --- a/lib/1d_complex.js +++ /dev/null @@ -1,97 +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'; - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 4 ]; -* -* // Define the array strides: -* var sx = [ 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every1d( x ); -* // returns true -*/ -function every1d( x ) { - var xbuf; - var dx0; - var S0; - var ix; - var i0; - - // Note on variable naming convention: S#, dx#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables: dimensions and loop offset (pointer) increments: - S0 = x.shape[ 0 ]; - dx0 = x.strides[ 0 ]; - - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - return true; -} - - -// EXPORTS // - -module.exports = every1d; diff --git a/lib/2d.js b/lib/2d.js deleted file mode 100644 index 8087d7a..0000000 --- a/lib/2d.js +++ /dev/null @@ -1,122 +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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every2d( x ); -* // returns true -*/ -function every2d( x ) { - var xbuf; - var dx0; - var dx1; - var sh; - var S0; - var S1; - var sx; - var ix; - var i0; - var i1; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 1 ]; - S1 = sh[ 0 ]; - dx0 = sx[ 1 ]; // offset increment for innermost loop - dx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - return true; -} - - -// EXPORTS // - -module.exports = every2d; diff --git a/lib/2d_accessors.js b/lib/2d_accessors.js deleted file mode 100644 index 298f397..0000000 --- a/lib/2d_accessors.js +++ /dev/null @@ -1,129 +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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every2d( x ); -* // returns true -*/ -function every2d( x ) { - var xbuf; - var get; - var dx0; - var dx1; - var sh; - var S0; - var S1; - var sx; - var ix; - var i0; - var i1; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 1 ]; - S1 = sh[ 0 ]; - dx0 = sx[ 1 ]; // offset increment for innermost loop - dx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - return true; -} - - -// EXPORTS // - -module.exports = every2d; diff --git a/lib/2d_blocked.js b/lib/2d_blocked.js deleted file mode 100644 index b623d09..0000000 --- a/lib/2d_blocked.js +++ /dev/null @@ -1,150 +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 loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery2d( x ); -* // returns true -*/ -function blockedevery2d( x ) { - var bsize; - var xbuf; - var dx0; - var dx1; - var ox1; - var sh; - var s0; - var s1; - var sx; - var ox; - var ix; - var i0; - var i1; - var j0; - var j1; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - ox1 = ox + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery2d; diff --git a/lib/2d_blocked_accessors.js b/lib/2d_blocked_accessors.js deleted file mode 100644 index eddb1f1..0000000 --- a/lib/2d_blocked_accessors.js +++ /dev/null @@ -1,157 +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 loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery2d( x ); -* // returns true -*/ -function blockedevery2d( x ) { - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var ox1; - var sh; - var s0; - var s1; - var sx; - var ox; - var ix; - var i0; - var i1; - var j0; - var j1; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - ox1 = ox + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery2d; diff --git a/lib/2d_blocked_complex.js b/lib/2d_blocked_complex.js deleted file mode 100644 index 04daaa1..0000000 --- a/lib/2d_blocked_complex.js +++ /dev/null @@ -1,150 +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 loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery2d( x ); -* // returns true -*/ -function blockedevery2d( x ) { - var bsize; - var xbuf; - var dx0; - var dx1; - var ox1; - var sh; - var s0; - var s1; - var sx; - var ox; - var ix; - var i0; - var i1; - var j0; - var j1; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - ox1 = ox + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery2d; diff --git a/lib/2d_complex.js b/lib/2d_complex.js deleted file mode 100644 index ac6d696..0000000 --- a/lib/2d_complex.js +++ /dev/null @@ -1,122 +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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every2d( x ); -* // returns true -*/ -function every2d( x ) { - var xbuf; - var dx0; - var dx1; - var sh; - var S0; - var S1; - var sx; - var ix; - var i0; - var i1; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 1 ]; - S1 = sh[ 0 ]; - dx0 = sx[ 1 ]; // offset increment for innermost loop - dx1 = sx[ 0 ] - ( S0*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - return true; -} - - -// EXPORTS // - -module.exports = every2d; diff --git a/lib/3d.js b/lib/3d.js deleted file mode 100644 index 2431887..0000000 --- a/lib/3d.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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every3d( x ); -* // returns true -*/ -function every3d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var sh; - var S0; - var S1; - var S2; - var sx; - var ix; - var i0; - var i1; - var i2; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 2 ]; - S1 = sh[ 1 ]; - S2 = sh[ 0 ]; - dx0 = sx[ 2 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[2] ); - dx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - return true; -} - - -// EXPORTS // - -module.exports = every3d; diff --git a/lib/3d_accessors.js b/lib/3d_accessors.js deleted file mode 100644 index 94ac894..0000000 --- a/lib/3d_accessors.js +++ /dev/null @@ -1,139 +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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every3d( x ); -* // returns true -*/ -function every3d( x ) { - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var sh; - var S0; - var S1; - var S2; - var sx; - var ix; - var i0; - var i1; - var i2; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 2 ]; - S1 = sh[ 1 ]; - S2 = sh[ 0 ]; - dx0 = sx[ 2 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[2] ); - dx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - return true; -} - - -// EXPORTS // - -module.exports = every3d; diff --git a/lib/3d_blocked.js b/lib/3d_blocked.js deleted file mode 100644 index 64a1766..0000000 --- a/lib/3d_blocked.js +++ /dev/null @@ -1,171 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery3d( x ); -* // returns true -*/ -function blockedevery3d( x ) { - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var ox1; - var ox2; - var sh; - var s0; - var s1; - var s2; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var j0; - var j1; - var j2; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - ox2 = ox + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery3d; diff --git a/lib/3d_blocked_accessors.js b/lib/3d_blocked_accessors.js deleted file mode 100644 index d9e9161..0000000 --- a/lib/3d_blocked_accessors.js +++ /dev/null @@ -1,178 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery3d( x ); -* // returns true -*/ -function blockedevery3d( x ) { - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var ox1; - var ox2; - var sh; - var s0; - var s1; - var s2; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var j0; - var j1; - var j2; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - ox2 = ox + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery3d; diff --git a/lib/3d_blocked_complex.js b/lib/3d_blocked_complex.js deleted file mode 100644 index ba90b00..0000000 --- a/lib/3d_blocked_complex.js +++ /dev/null @@ -1,171 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery3d( x ); -* // returns true -*/ -function blockedevery3d( x ) { - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var ox1; - var ox2; - var sh; - var s0; - var s1; - var s2; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var j0; - var j1; - var j2; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - ox2 = ox + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery3d; diff --git a/lib/3d_complex.js b/lib/3d_complex.js deleted file mode 100644 index f3e8e70..0000000 --- a/lib/3d_complex.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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every3d( x ); -* // returns true -*/ -function every3d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var sh; - var S0; - var S1; - var S2; - var sx; - var ix; - var i0; - var i1; - var i2; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 2 ]; - S1 = sh[ 1 ]; - S2 = sh[ 0 ]; - dx0 = sx[ 2 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[2] ); - dx2 = sx[ 0 ] - ( S1*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - return true; -} - - -// EXPORTS // - -module.exports = every3d; diff --git a/lib/4d.js b/lib/4d.js deleted file mode 100644 index 767965f..0000000 --- a/lib/4d.js +++ /dev/null @@ -1,142 +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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every4d( x ); -* // returns true -*/ -function every4d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var sh; - var S0; - var S1; - var S2; - var S3; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 3 ]; - S1 = sh[ 2 ]; - S2 = sh[ 1 ]; - S3 = sh[ 0 ]; - dx0 = sx[ 3 ]; // offset increment for innermost loop - dx1 = sx[ 2 ] - ( S0*sx[3] ); - dx2 = sx[ 1 ] - ( S1*sx[2] ); - dx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - return true; -} - - -// EXPORTS // - -module.exports = every4d; diff --git a/lib/4d_accessors.js b/lib/4d_accessors.js deleted file mode 100644 index 5d7817b..0000000 --- a/lib/4d_accessors.js +++ /dev/null @@ -1,149 +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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every4d( x ); -* // returns true -*/ -function every4d( x ) { - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var sh; - var S0; - var S1; - var S2; - var S3; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 3 ]; - S1 = sh[ 2 ]; - S2 = sh[ 1 ]; - S3 = sh[ 0 ]; - dx0 = sx[ 3 ]; // offset increment for innermost loop - dx1 = sx[ 2 ] - ( S0*sx[3] ); - dx2 = sx[ 1 ] - ( S1*sx[2] ); - dx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - return true; -} - - -// EXPORTS // - -module.exports = every4d; diff --git a/lib/4d_blocked.js b/lib/4d_blocked.js deleted file mode 100644 index 7807a4d..0000000 --- a/lib/4d_blocked.js +++ /dev/null @@ -1,190 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery4d( x ); -* // returns true -*/ -function blockedevery4d( x ) { - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var ox1; - var ox2; - var ox3; - var sh; - var s0; - var s1; - var s2; - var s3; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var j0; - var j1; - var j2; - var j3; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - ox3 = ox + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery4d; diff --git a/lib/4d_blocked_accessors.js b/lib/4d_blocked_accessors.js deleted file mode 100644 index bd8b055..0000000 --- a/lib/4d_blocked_accessors.js +++ /dev/null @@ -1,197 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery4d( x ); -* // returns true -*/ -function blockedevery4d( x ) { - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var ox1; - var ox2; - var ox3; - var sh; - var s0; - var s1; - var s2; - var s3; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var j0; - var j1; - var j2; - var j3; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - ox3 = ox + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery4d; diff --git a/lib/4d_blocked_complex.js b/lib/4d_blocked_complex.js deleted file mode 100644 index 105db47..0000000 --- a/lib/4d_blocked_complex.js +++ /dev/null @@ -1,190 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery4d( x ); -* // returns true -*/ -function blockedevery4d( x ) { - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var ox1; - var ox2; - var ox3; - var sh; - var s0; - var s1; - var s2; - var s3; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var j0; - var j1; - var j2; - var j3; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - ox3 = ox + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery4d; diff --git a/lib/4d_complex.js b/lib/4d_complex.js deleted file mode 100644 index 23a20ca..0000000 --- a/lib/4d_complex.js +++ /dev/null @@ -1,142 +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 strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every4d( x ); -* // returns true -*/ -function every4d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var sh; - var S0; - var S1; - var S2; - var S3; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 3 ]; - S1 = sh[ 2 ]; - S2 = sh[ 1 ]; - S3 = sh[ 0 ]; - dx0 = sx[ 3 ]; // offset increment for innermost loop - dx1 = sx[ 2 ] - ( S0*sx[3] ); - dx2 = sx[ 1 ] - ( S1*sx[2] ); - dx3 = sx[ 0 ] - ( S2*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - return true; -} - - -// EXPORTS // - -module.exports = every4d; diff --git a/lib/5d.js b/lib/5d.js deleted file mode 100644 index 6fcf429..0000000 --- a/lib/5d.js +++ /dev/null @@ -1,154 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every5d( x ); -* // returns true -*/ -function every5d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 4 ]; - S1 = sh[ 3 ]; - S2 = sh[ 2 ]; - S3 = sh[ 1 ]; - S4 = sh[ 0 ]; - dx0 = sx[ 4 ]; // offset increment for innermost loop - dx1 = sx[ 3 ] - ( S0*sx[4] ); - dx2 = sx[ 2 ] - ( S1*sx[3] ); - dx3 = sx[ 1 ] - ( S2*sx[2] ); - dx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - return true; -} - - -// EXPORTS // - -module.exports = every5d; diff --git a/lib/5d_accessors.js b/lib/5d_accessors.js deleted file mode 100644 index ff75cc4..0000000 --- a/lib/5d_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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every5d( x ); -* // returns true -*/ -function every5d( x ) { - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 4 ]; - S1 = sh[ 3 ]; - S2 = sh[ 2 ]; - S3 = sh[ 1 ]; - S4 = sh[ 0 ]; - dx0 = sx[ 4 ]; // offset increment for innermost loop - dx1 = sx[ 3 ] - ( S0*sx[4] ); - dx2 = sx[ 2 ] - ( S1*sx[3] ); - dx3 = sx[ 1 ] - ( S2*sx[2] ); - dx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - return true; -} - - -// EXPORTS // - -module.exports = every5d; diff --git a/lib/5d_blocked.js b/lib/5d_blocked.js deleted file mode 100644 index 73212e7..0000000 --- a/lib/5d_blocked.js +++ /dev/null @@ -1,209 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery5d( x ); -* // returns true -*/ -function blockedevery5d( x ) { - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var ox1; - var ox2; - var ox3; - var ox4; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var j0; - var j1; - var j2; - var j3; - var j4; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - ox4 = ox + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery5d; diff --git a/lib/5d_blocked_accessors.js b/lib/5d_blocked_accessors.js deleted file mode 100644 index 9075e8e..0000000 --- a/lib/5d_blocked_accessors.js +++ /dev/null @@ -1,216 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery5d( x ); -* // returns true -*/ -function blockedevery5d( x ) { - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var ox1; - var ox2; - var ox3; - var ox4; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var j0; - var j1; - var j2; - var j3; - var j4; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - ox4 = ox + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery5d; diff --git a/lib/5d_blocked_complex.js b/lib/5d_blocked_complex.js deleted file mode 100644 index 0edb4f0..0000000 --- a/lib/5d_blocked_complex.js +++ /dev/null @@ -1,209 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery5d( x ); -* // returns true -*/ -function blockedevery5d( x ) { - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var ox1; - var ox2; - var ox3; - var ox4; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var j0; - var j1; - var j2; - var j3; - var j4; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - ox4 = ox + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery5d; diff --git a/lib/5d_complex.js b/lib/5d_complex.js deleted file mode 100644 index afe7c19..0000000 --- a/lib/5d_complex.js +++ /dev/null @@ -1,154 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every5d( x ); -* // returns true -*/ -function every5d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 4 ]; - S1 = sh[ 3 ]; - S2 = sh[ 2 ]; - S3 = sh[ 1 ]; - S4 = sh[ 0 ]; - dx0 = sx[ 4 ]; // offset increment for innermost loop - dx1 = sx[ 3 ] - ( S0*sx[4] ); - dx2 = sx[ 2 ] - ( S1*sx[3] ); - dx3 = sx[ 1 ] - ( S2*sx[2] ); - dx4 = sx[ 0 ] - ( S3*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - return true; -} - - -// EXPORTS // - -module.exports = every5d; diff --git a/lib/6d.js b/lib/6d.js deleted file mode 100644 index b777b06..0000000 --- a/lib/6d.js +++ /dev/null @@ -1,164 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every6d( x ); -* // returns true -*/ -function every6d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 5 ]; - S1 = sh[ 4 ]; - S2 = sh[ 3 ]; - S3 = sh[ 2 ]; - S4 = sh[ 1 ]; - S5 = sh[ 0 ]; - dx0 = sx[ 5 ]; // offset increment for innermost loop - dx1 = sx[ 4 ] - ( S0*sx[5] ); - dx2 = sx[ 3 ] - ( S1*sx[4] ); - dx3 = sx[ 2 ] - ( S2*sx[3] ); - dx4 = sx[ 1 ] - ( S3*sx[2] ); - dx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - return true; -} - - -// EXPORTS // - -module.exports = every6d; diff --git a/lib/6d_accessors.js b/lib/6d_accessors.js deleted file mode 100644 index 38dc2b4..0000000 --- a/lib/6d_accessors.js +++ /dev/null @@ -1,171 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every6d( x ); -* // returns true -*/ -function every6d( x ) { - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 5 ]; - S1 = sh[ 4 ]; - S2 = sh[ 3 ]; - S3 = sh[ 2 ]; - S4 = sh[ 1 ]; - S5 = sh[ 0 ]; - dx0 = sx[ 5 ]; // offset increment for innermost loop - dx1 = sx[ 4 ] - ( S0*sx[5] ); - dx2 = sx[ 3 ] - ( S1*sx[4] ); - dx3 = sx[ 2 ] - ( S2*sx[3] ); - dx4 = sx[ 1 ] - ( S3*sx[2] ); - dx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - return true; -} - - -// EXPORTS // - -module.exports = every6d; diff --git a/lib/6d_blocked.js b/lib/6d_blocked.js deleted file mode 100644 index 4dfece1..0000000 --- a/lib/6d_blocked.js +++ /dev/null @@ -1,228 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery6d( x ); -* // returns true -*/ -function blockedevery6d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - ox5 = ox + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery6d; diff --git a/lib/6d_blocked_accessors.js b/lib/6d_blocked_accessors.js deleted file mode 100644 index 55584c4..0000000 --- a/lib/6d_blocked_accessors.js +++ /dev/null @@ -1,235 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery6d( x ); -* // returns true -*/ -function blockedevery6d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - ox5 = ox + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery6d; diff --git a/lib/6d_blocked_complex.js b/lib/6d_blocked_complex.js deleted file mode 100644 index 5c51ad6..0000000 --- a/lib/6d_blocked_complex.js +++ /dev/null @@ -1,228 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery6d( x ); -* // returns true -*/ -function blockedevery6d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - ox5 = ox + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery6d; diff --git a/lib/6d_complex.js b/lib/6d_complex.js deleted file mode 100644 index 3cac509..0000000 --- a/lib/6d_complex.js +++ /dev/null @@ -1,164 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every6d( x ); -* // returns true -*/ -function every6d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 5 ]; - S1 = sh[ 4 ]; - S2 = sh[ 3 ]; - S3 = sh[ 2 ]; - S4 = sh[ 1 ]; - S5 = sh[ 0 ]; - dx0 = sx[ 5 ]; // offset increment for innermost loop - dx1 = sx[ 4 ] - ( S0*sx[5] ); - dx2 = sx[ 3 ] - ( S1*sx[4] ); - dx3 = sx[ 2 ] - ( S2*sx[3] ); - dx4 = sx[ 1 ] - ( S3*sx[2] ); - dx5 = sx[ 0 ] - ( S4*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - return true; -} - - -// EXPORTS // - -module.exports = every6d; diff --git a/lib/7d.js b/lib/7d.js deleted file mode 100644 index 16833b5..0000000 --- a/lib/7d.js +++ /dev/null @@ -1,174 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every7d( x ); -* // returns true -*/ -function every7d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 6 ]; - S1 = sh[ 5 ]; - S2 = sh[ 4 ]; - S3 = sh[ 3 ]; - S4 = sh[ 2 ]; - S5 = sh[ 1 ]; - S6 = sh[ 0 ]; - dx0 = sx[ 6 ]; // offset increment for innermost loop - dx1 = sx[ 5 ] - ( S0*sx[6] ); - dx2 = sx[ 4 ] - ( S1*sx[5] ); - dx3 = sx[ 3 ] - ( S2*sx[4] ); - dx4 = sx[ 2 ] - ( S3*sx[3] ); - dx5 = sx[ 1 ] - ( S4*sx[2] ); - dx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - return true; -} - - -// EXPORTS // - -module.exports = every7d; diff --git a/lib/7d_accessors.js b/lib/7d_accessors.js deleted file mode 100644 index fbf653d..0000000 --- a/lib/7d_accessors.js +++ /dev/null @@ -1,181 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every7d( x ); -* // returns true -*/ -function every7d( x ) { - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 6 ]; - S1 = sh[ 5 ]; - S2 = sh[ 4 ]; - S3 = sh[ 3 ]; - S4 = sh[ 2 ]; - S5 = sh[ 1 ]; - S6 = sh[ 0 ]; - dx0 = sx[ 6 ]; // offset increment for innermost loop - dx1 = sx[ 5 ] - ( S0*sx[6] ); - dx2 = sx[ 4 ] - ( S1*sx[5] ); - dx3 = sx[ 3 ] - ( S2*sx[4] ); - dx4 = sx[ 2 ] - ( S3*sx[3] ); - dx5 = sx[ 1 ] - ( S4*sx[2] ); - dx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - return true; -} - - -// EXPORTS // - -module.exports = every7d; diff --git a/lib/7d_blocked.js b/lib/7d_blocked.js deleted file mode 100644 index a0a7f02..0000000 --- a/lib/7d_blocked.js +++ /dev/null @@ -1,247 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery7d( x ); -* // returns true -*/ -function blockedevery7d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - ox6 = ox + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery7d; diff --git a/lib/7d_blocked_accessors.js b/lib/7d_blocked_accessors.js deleted file mode 100644 index 79d752f..0000000 --- a/lib/7d_blocked_accessors.js +++ /dev/null @@ -1,254 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery7d( x ); -* // returns true -*/ -function blockedevery7d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - ox6 = ox + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery7d; diff --git a/lib/7d_blocked_complex.js b/lib/7d_blocked_complex.js deleted file mode 100644 index 2998d8c..0000000 --- a/lib/7d_blocked_complex.js +++ /dev/null @@ -1,247 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery7d( x ); -* // returns true -*/ -function blockedevery7d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - ox6 = ox + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery7d; diff --git a/lib/7d_complex.js b/lib/7d_complex.js deleted file mode 100644 index 5ed83c5..0000000 --- a/lib/7d_complex.js +++ /dev/null @@ -1,174 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every7d( x ); -* // returns true -*/ -function every7d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 6 ]; - S1 = sh[ 5 ]; - S2 = sh[ 4 ]; - S3 = sh[ 3 ]; - S4 = sh[ 2 ]; - S5 = sh[ 1 ]; - S6 = sh[ 0 ]; - dx0 = sx[ 6 ]; // offset increment for innermost loop - dx1 = sx[ 5 ] - ( S0*sx[6] ); - dx2 = sx[ 4 ] - ( S1*sx[5] ); - dx3 = sx[ 3 ] - ( S2*sx[4] ); - dx4 = sx[ 2 ] - ( S3*sx[3] ); - dx5 = sx[ 1 ] - ( S4*sx[2] ); - dx6 = sx[ 0 ] - ( S5*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - return true; -} - - -// EXPORTS // - -module.exports = every7d; diff --git a/lib/8d.js b/lib/8d.js deleted file mode 100644 index fbb4985..0000000 --- a/lib/8d.js +++ /dev/null @@ -1,184 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every8d( x ); -* // returns true -*/ -function every8d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 7 ]; - S1 = sh[ 6 ]; - S2 = sh[ 5 ]; - S3 = sh[ 4 ]; - S4 = sh[ 3 ]; - S5 = sh[ 2 ]; - S6 = sh[ 1 ]; - S7 = sh[ 0 ]; - dx0 = sx[ 7 ]; // offset increment for innermost loop - dx1 = sx[ 6 ] - ( S0*sx[7] ); - dx2 = sx[ 5 ] - ( S1*sx[6] ); - dx3 = sx[ 4 ] - ( S2*sx[5] ); - dx4 = sx[ 3 ] - ( S3*sx[4] ); - dx5 = sx[ 2 ] - ( S4*sx[3] ); - dx6 = sx[ 1 ] - ( S5*sx[2] ); - dx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - return true; -} - - -// EXPORTS // - -module.exports = every8d; diff --git a/lib/8d_accessors.js b/lib/8d_accessors.js deleted file mode 100644 index 145860c..0000000 --- a/lib/8d_accessors.js +++ /dev/null @@ -1,191 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every8d( x ); -* // returns true -*/ -function every8d( x ) { - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 7 ]; - S1 = sh[ 6 ]; - S2 = sh[ 5 ]; - S3 = sh[ 4 ]; - S4 = sh[ 3 ]; - S5 = sh[ 2 ]; - S6 = sh[ 1 ]; - S7 = sh[ 0 ]; - dx0 = sx[ 7 ]; // offset increment for innermost loop - dx1 = sx[ 6 ] - ( S0*sx[7] ); - dx2 = sx[ 5 ] - ( S1*sx[6] ); - dx3 = sx[ 4 ] - ( S2*sx[5] ); - dx4 = sx[ 3 ] - ( S3*sx[4] ); - dx5 = sx[ 2 ] - ( S4*sx[3] ); - dx6 = sx[ 1 ] - ( S5*sx[2] ); - dx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - return true; -} - - -// EXPORTS // - -module.exports = every8d; diff --git a/lib/8d_blocked.js b/lib/8d_blocked.js deleted file mode 100644 index ec5d4f1..0000000 --- a/lib/8d_blocked.js +++ /dev/null @@ -1,266 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery8d( x ); -* // returns true -*/ -function blockedevery8d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - ox7 = ox + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery8d; diff --git a/lib/8d_blocked_accessors.js b/lib/8d_blocked_accessors.js deleted file mode 100644 index d0465cc..0000000 --- a/lib/8d_blocked_accessors.js +++ /dev/null @@ -1,273 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery8d( x ); -* // returns true -*/ -function blockedevery8d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - ox7 = ox + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery8d; diff --git a/lib/8d_blocked_complex.js b/lib/8d_blocked_complex.js deleted file mode 100644 index 24696b3..0000000 --- a/lib/8d_blocked_complex.js +++ /dev/null @@ -1,266 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery8d( x ); -* // returns true -*/ -function blockedevery8d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - ox7 = ox + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery8d; diff --git a/lib/8d_complex.js b/lib/8d_complex.js deleted file mode 100644 index f9392bc..0000000 --- a/lib/8d_complex.js +++ /dev/null @@ -1,184 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every8d( x ); -* // returns true -*/ -function every8d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 7 ]; - S1 = sh[ 6 ]; - S2 = sh[ 5 ]; - S3 = sh[ 4 ]; - S4 = sh[ 3 ]; - S5 = sh[ 2 ]; - S6 = sh[ 1 ]; - S7 = sh[ 0 ]; - dx0 = sx[ 7 ]; // offset increment for innermost loop - dx1 = sx[ 6 ] - ( S0*sx[7] ); - dx2 = sx[ 5 ] - ( S1*sx[6] ); - dx3 = sx[ 4 ] - ( S2*sx[5] ); - dx4 = sx[ 3 ] - ( S3*sx[4] ); - dx5 = sx[ 2 ] - ( S4*sx[3] ); - dx6 = sx[ 1 ] - ( S5*sx[2] ); - dx7 = sx[ 0 ] - ( S6*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - return true; -} - - -// EXPORTS // - -module.exports = every8d; diff --git a/lib/9d.js b/lib/9d.js deleted file mode 100644 index 07ec1e1..0000000 --- a/lib/9d.js +++ /dev/null @@ -1,194 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every9d( x ); -* // returns true -*/ -function every9d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 8 ]; - S1 = sh[ 7 ]; - S2 = sh[ 6 ]; - S3 = sh[ 5 ]; - S4 = sh[ 4 ]; - S5 = sh[ 3 ]; - S6 = sh[ 2 ]; - S7 = sh[ 1 ]; - S8 = sh[ 0 ]; - dx0 = sx[ 8 ]; // offset increment for innermost loop - dx1 = sx[ 7 ] - ( S0*sx[8] ); - dx2 = sx[ 6 ] - ( S1*sx[7] ); - dx3 = sx[ 5 ] - ( S2*sx[6] ); - dx4 = sx[ 4 ] - ( S3*sx[5] ); - dx5 = sx[ 3 ] - ( S4*sx[4] ); - dx6 = sx[ 2 ] - ( S5*sx[3] ); - dx7 = sx[ 1 ] - ( S6*sx[2] ); - dx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - return true; -} - - -// EXPORTS // - -module.exports = every9d; diff --git a/lib/9d_accessors.js b/lib/9d_accessors.js deleted file mode 100644 index 52413ca..0000000 --- a/lib/9d_accessors.js +++ /dev/null @@ -1,201 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = every9d( x ); -* // returns true -*/ -function every9d( x ) { - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 8 ]; - S1 = sh[ 7 ]; - S2 = sh[ 6 ]; - S3 = sh[ 5 ]; - S4 = sh[ 4 ]; - S5 = sh[ 3 ]; - S6 = sh[ 2 ]; - S7 = sh[ 1 ]; - S8 = sh[ 0 ]; - dx0 = sx[ 8 ]; // offset increment for innermost loop - dx1 = sx[ 7 ] - ( S0*sx[8] ); - dx2 = sx[ 6 ] - ( S1*sx[7] ); - dx3 = sx[ 5 ] - ( S2*sx[6] ); - dx4 = sx[ 4 ] - ( S3*sx[5] ); - dx5 = sx[ 3 ] - ( S4*sx[4] ); - dx6 = sx[ 2 ] - ( S5*sx[3] ); - dx7 = sx[ 1 ] - ( S6*sx[2] ); - dx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - return true; -} - - -// EXPORTS // - -module.exports = every9d; diff --git a/lib/9d_blocked.js b/lib/9d_blocked.js deleted file mode 100644 index 2846a3d..0000000 --- a/lib/9d_blocked.js +++ /dev/null @@ -1,285 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 12, 12, 12, 12, 12, 12, 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery9d( x ); -* // returns true -*/ -function blockedevery9d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var s8; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - s8 = j8; - j8 = 0; - } else { - s8 = bsize; - j8 -= bsize; - } - ox8 = ox + ( j8*sx[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( s7*sx[7] ); - ox7 = ox8 + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < s8; i8++ ) { - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !xbuf[ ix ] ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery9d; diff --git a/lib/9d_blocked_accessors.js b/lib/9d_blocked_accessors.js deleted file mode 100644 index 59e7c5e..0000000 --- a/lib/9d_blocked_accessors.js +++ /dev/null @@ -1,292 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 4, 4, 4, 4, 4, 2, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = blockedevery9d( x ); -* // returns true -*/ -function blockedevery9d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var get; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var s8; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Cache accessor: - get = x.accessors[0]; - - // Iterate over blocks... - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - s8 = j8; - j8 = 0; - } else { - s8 = bsize; - j8 -= bsize; - } - ox8 = ox + ( j8*sx[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( s7*sx[7] ); - ox7 = ox8 + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < s8; i8++ ) { - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !get( xbuf, ix ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery9d; diff --git a/lib/9d_blocked_complex.js b/lib/9d_blocked_complex.js deleted file mode 100644 index fbe52bd..0000000 --- a/lib/9d_blocked_complex.js +++ /dev/null @@ -1,285 +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. -*/ - -/* eslint-disable max-depth, max-len */ - -'use strict'; - -// MODULES // - -var loopOrder = require( '@stdlib/ndarray-base-nullary-loop-interchange-order' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy via loop blocking. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = blockedevery9d( x ); -* // returns true -*/ -function blockedevery9d( x ) { // eslint-disable-line max-statements - var bsize; - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var ox1; - var ox2; - var ox3; - var ox4; - var ox5; - var ox6; - var ox7; - var ox8; - var sh; - var s0; - var s1; - var s2; - var s3; - var s4; - var s5; - var s6; - var s7; - var s8; - var sx; - var ox; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - var j0; - var j1; - var j2; - var j3; - var j4; - var j5; - var j6; - var j7; - var j8; - var o; - - // Note on variable naming convention: s#, dx#, dy#, i#, j# where # corresponds to the loop number, with `0` being the innermost loop... - - // Resolve the loop interchange order: - o = loopOrder( x.shape, x.strides ); - sh = o.sh; - sx = o.sx; - - // Determine the block size: - bsize = blockSize( x.dtype ); - - // Set a pointer to the first indexed element: - ox = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Cache the offset increment for the innermost loop: - dx0 = sx[0]; - - // Iterate over blocks... - for ( j8 = sh[8]; j8 > 0; ) { - if ( j8 < bsize ) { - s8 = j8; - j8 = 0; - } else { - s8 = bsize; - j8 -= bsize; - } - ox8 = ox + ( j8*sx[8] ); - for ( j7 = sh[7]; j7 > 0; ) { - if ( j7 < bsize ) { - s7 = j7; - j7 = 0; - } else { - s7 = bsize; - j7 -= bsize; - } - dx8 = sx[8] - ( s7*sx[7] ); - ox7 = ox8 + ( j7*sx[7] ); - for ( j6 = sh[6]; j6 > 0; ) { - if ( j6 < bsize ) { - s6 = j6; - j6 = 0; - } else { - s6 = bsize; - j6 -= bsize; - } - dx7 = sx[7] - ( s6*sx[6] ); - ox6 = ox7 + ( j6*sx[6] ); - for ( j5 = sh[5]; j5 > 0; ) { - if ( j5 < bsize ) { - s5 = j5; - j5 = 0; - } else { - s5 = bsize; - j5 -= bsize; - } - dx6 = sx[6] - ( s5*sx[5] ); - ox5 = ox6 + ( j5*sx[5] ); - for ( j4 = sh[4]; j4 > 0; ) { - if ( j4 < bsize ) { - s4 = j4; - j4 = 0; - } else { - s4 = bsize; - j4 -= bsize; - } - dx5 = sx[5] - ( s4*sx[4] ); - ox4 = ox5 + ( j4*sx[4] ); - for ( j3 = sh[3]; j3 > 0; ) { - if ( j3 < bsize ) { - s3 = j3; - j3 = 0; - } else { - s3 = bsize; - j3 -= bsize; - } - dx4 = sx[4] - ( s3*sx[3] ); - ox3 = ox4 + ( j3*sx[3] ); - for ( j2 = sh[2]; j2 > 0; ) { - if ( j2 < bsize ) { - s2 = j2; - j2 = 0; - } else { - s2 = bsize; - j2 -= bsize; - } - dx3 = sx[3] - ( s2*sx[2] ); - ox2 = ox3 + ( j2*sx[2] ); - for ( j1 = sh[1]; j1 > 0; ) { - if ( j1 < bsize ) { - s1 = j1; - j1 = 0; - } else { - s1 = bsize; - j1 -= bsize; - } - dx2 = sx[2] - ( s1*sx[1] ); - ox1 = ox2 + ( j1*sx[1] ); - for ( j0 = sh[0]; j0 > 0; ) { - if ( j0 < bsize ) { - s0 = j0; - j0 = 0; - } else { - s0 = bsize; - j0 -= bsize; - } - // Compute the index offset for the first input ndarray element in the current block: - ix = ox1 + ( j0*sx[0] ); - - // Compute the loop offset increment: - dx1 = sx[1] - ( s0*sx[0] ); - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < s8; i8++ ) { - for ( i7 = 0; i7 < s7; i7++ ) { - for ( i6 = 0; i6 < s6; i6++ ) { - for ( i5 = 0; i5 < s5; i5++ ) { - for ( i4 = 0; i4 < s4; i4++ ) { - for ( i3 = 0; i3 < s3; i3++ ) { - for ( i2 = 0; i2 < s2; i2++ ) { - for ( i1 = 0; i1 < s1; i1++ ) { - for ( i0 = 0; i0 < s0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - } - } - } - } - } - } - } - } - } - return true; -} - - -// EXPORTS // - -module.exports = blockedevery9d; diff --git a/lib/9d_complex.js b/lib/9d_complex.js deleted file mode 100644 index aef64b6..0000000 --- a/lib/9d_complex.js +++ /dev/null @@ -1,194 +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. -*/ - -/* eslint-disable max-depth */ - -'use strict'; - -// MODULES // - -var strides2order = require( '@stdlib/ndarray-base-strides2order' ); - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 1, 1, 1, 1, 1, 1, 1, 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 8, 8, 8, 8, 8, 8, 8, 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every9d( x ); -* // returns true -*/ -function every9d( x ) { - var xbuf; - var dx0; - var dx1; - var dx2; - var dx3; - var dx4; - var dx5; - var dx6; - var dx7; - var dx8; - var sh; - var S0; - var S1; - var S2; - var S3; - var S4; - var S5; - var S6; - var S7; - var S8; - var sx; - var ix; - var i0; - var i1; - var i2; - var i3; - var i4; - var i5; - var i6; - var i7; - var i8; - - // Note on variable naming convention: S#, dx#, dy#, i# where # corresponds to the loop number, with `0` being the innermost loop... - - // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... - sh = x.shape; - sx = x.strides; - if ( strides2order( sx ) === 1 ) { - // For row-major ndarrays, the last dimensions have the fastest changing indices... - S0 = sh[ 8 ]; - S1 = sh[ 7 ]; - S2 = sh[ 6 ]; - S3 = sh[ 5 ]; - S4 = sh[ 4 ]; - S5 = sh[ 3 ]; - S6 = sh[ 2 ]; - S7 = sh[ 1 ]; - S8 = sh[ 0 ]; - dx0 = sx[ 8 ]; // offset increment for innermost loop - dx1 = sx[ 7 ] - ( S0*sx[8] ); - dx2 = sx[ 6 ] - ( S1*sx[7] ); - dx3 = sx[ 5 ] - ( S2*sx[6] ); - dx4 = sx[ 4 ] - ( S3*sx[5] ); - dx5 = sx[ 3 ] - ( S4*sx[4] ); - dx6 = sx[ 2 ] - ( S5*sx[3] ); - dx7 = sx[ 1 ] - ( S6*sx[2] ); - dx8 = sx[ 0 ] - ( S7*sx[1] ); // offset increment for outermost loop - } else { // order === 'column-major' - // For column-major ndarrays, the first dimensions have the fastest changing indices... - S0 = sh[ 0 ]; - S1 = sh[ 1 ]; - S2 = sh[ 2 ]; - S3 = sh[ 3 ]; - S4 = sh[ 4 ]; - S5 = sh[ 5 ]; - S6 = sh[ 6 ]; - S7 = sh[ 7 ]; - S8 = sh[ 8 ]; - dx0 = sx[ 0 ]; // offset increment for innermost loop - dx1 = sx[ 1 ] - ( S0*sx[0] ); - dx2 = sx[ 2 ] - ( S1*sx[1] ); - dx3 = sx[ 3 ] - ( S2*sx[2] ); - dx4 = sx[ 4 ] - ( S3*sx[3] ); - dx5 = sx[ 5 ] - ( S4*sx[4] ); - dx6 = sx[ 6 ] - ( S5*sx[5] ); - dx7 = sx[ 7 ] - ( S6*sx[6] ); - dx8 = sx[ 8 ] - ( S7*sx[7] ); // offset increment for outermost loop - } - // Set a pointer to the first indexed element: - ix = x.offset; - - // Cache a reference to the input ndarray buffer: - xbuf = x.data; - - // Iterate over the ndarray dimensions... - for ( i8 = 0; i8 < S8; i8++ ) { - for ( i7 = 0; i7 < S7; i7++ ) { - for ( i6 = 0; i6 < S6; i6++ ) { - for ( i5 = 0; i5 < S5; i5++ ) { - for ( i4 = 0; i4 < S4; i4++ ) { - for ( i3 = 0; i3 < S3; i3++ ) { - for ( i2 = 0; i2 < S2; i2++ ) { - for ( i1 = 0; i1 < S1; i1++ ) { - for ( i0 = 0; i0 < S0; i0++ ) { - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - ix += dx0; - } - ix += dx1; - } - ix += dx2; - } - ix += dx3; - } - ix += dx4; - } - ix += dx5; - } - ix += dx6; - } - ix += dx7; - } - ix += dx8; - } - return true; -} - - -// EXPORTS // - -module.exports = every9d; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index cadb67d..0000000 --- a/lib/index.js +++ /dev/null @@ -1,64 +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'; - -/** -* Test whether every element in an ndarray is truthy. -* -* @module @stdlib/ndarray-base-every -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* var every = require( '@stdlib/ndarray-base-every' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every( [ x ] ); -* // returns true -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 08a32a5..0000000 --- a/lib/main.js +++ /dev/null @@ -1,375 +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 isComplexArray = require( '@stdlib/array-base-assert-is-complex-typed-array' ); -var isBooleanArray = require( '@stdlib/array-base-assert-is-booleanarray' ); -var iterationOrder = require( '@stdlib/ndarray-base-iteration-order' ); -var minmaxViewBufferIndex = require( '@stdlib/ndarray-base-minmax-view-buffer-index' ); -var ndarray2object = require( '@stdlib/ndarray-base-ndarraylike2object' ); -var reinterpretComplex = require( '@stdlib/strided-base-reinterpret-complex' ); -var reinterpretBoolean = require( '@stdlib/strided-base-reinterpret-boolean' ); -var gscal = require( '@stdlib/blas-base-gscal' ); -var blockedaccessorevery2d = require( './2d_blocked_accessors.js' ); -var blockedaccessorevery3d = require( './3d_blocked_accessors.js' ); -var blockedaccessorevery4d = require( './4d_blocked_accessors.js' ); -var blockedaccessorevery5d = require( './5d_blocked_accessors.js' ); -var blockedaccessorevery6d = require( './6d_blocked_accessors.js' ); -var blockedaccessorevery7d = require( './7d_blocked_accessors.js' ); -var blockedaccessorevery8d = require( './8d_blocked_accessors.js' ); -var blockedaccessorevery9d = require( './9d_blocked_accessors.js' ); -var blockedaccessorevery10d = require( './10d_blocked_accessors.js' ); -var blockedcomplexevery2d = require( './2d_blocked_complex.js' ); -var blockedcomplexevery3d = require( './3d_blocked_complex.js' ); -var blockedcomplexevery4d = require( './4d_blocked_complex.js' ); -var blockedcomplexevery5d = require( './5d_blocked_complex.js' ); -var blockedcomplexevery6d = require( './6d_blocked_complex.js' ); -var blockedcomplexevery7d = require( './7d_blocked_complex.js' ); -var blockedcomplexevery8d = require( './8d_blocked_complex.js' ); -var blockedcomplexevery9d = require( './9d_blocked_complex.js' ); -var blockedcomplexevery10d = require( './10d_blocked_complex.js' ); -var blockedevery2d = require( './2d_blocked.js' ); -var blockedevery3d = require( './3d_blocked.js' ); -var blockedevery4d = require( './4d_blocked.js' ); -var blockedevery5d = require( './5d_blocked.js' ); -var blockedevery6d = require( './6d_blocked.js' ); -var blockedevery7d = require( './7d_blocked.js' ); -var blockedevery8d = require( './8d_blocked.js' ); -var blockedevery9d = require( './9d_blocked.js' ); -var blockedevery10d = require( './10d_blocked.js' ); -var accessorevery0d = require( './0d_accessors.js' ); -var accessorevery1d = require( './1d_accessors.js' ); -var accessorevery2d = require( './2d_accessors.js' ); -var accessorevery3d = require( './3d_accessors.js' ); -var accessorevery4d = require( './4d_accessors.js' ); -var accessorevery5d = require( './5d_accessors.js' ); -var accessorevery6d = require( './6d_accessors.js' ); -var accessorevery7d = require( './7d_accessors.js' ); -var accessorevery8d = require( './8d_accessors.js' ); -var accessorevery9d = require( './9d_accessors.js' ); -var accessorevery10d = require( './10d_accessors.js' ); -var accessoreverynd = require( './nd_accessors.js' ); -var complexevery0d = require( './0d_complex.js' ); -var complexevery1d = require( './1d_complex.js' ); -var complexevery2d = require( './2d_complex.js' ); -var complexevery3d = require( './3d_complex.js' ); -var complexevery4d = require( './4d_complex.js' ); -var complexevery5d = require( './5d_complex.js' ); -var complexevery6d = require( './6d_complex.js' ); -var complexevery7d = require( './7d_complex.js' ); -var complexevery8d = require( './8d_complex.js' ); -var complexevery9d = require( './9d_complex.js' ); -var complexevery10d = require( './10d_complex.js' ); -var complexeverynd = require( './nd_complex.js' ); -var every0d = require( './0d.js' ); -var every1d = require( './1d.js' ); -var every2d = require( './2d.js' ); -var every3d = require( './3d.js' ); -var every4d = require( './4d.js' ); -var every5d = require( './5d.js' ); -var every6d = require( './6d.js' ); -var every7d = require( './7d.js' ); -var every8d = require( './8d.js' ); -var every9d = require( './9d.js' ); -var every10d = require( './10d.js' ); -var everynd = require( './nd.js' ); - - -// VARIABLES // - -var EVERY = [ - every0d, - every1d, - every2d, - every3d, - every4d, - every5d, - every6d, - every7d, - every8d, - every9d, - every10d -]; -var ACCESSOR_EVERY = [ - accessorevery0d, - accessorevery1d, - accessorevery2d, - accessorevery3d, - accessorevery4d, - accessorevery5d, - accessorevery6d, - accessorevery7d, - accessorevery8d, - accessorevery9d, - accessorevery10d -]; -var COMPLEX_EVERY = [ - complexevery0d, - complexevery1d, - complexevery2d, - complexevery3d, - complexevery4d, - complexevery5d, - complexevery6d, - complexevery7d, - complexevery8d, - complexevery9d, - complexevery10d -]; -var BLOCKED_EVERY = [ - blockedevery2d, // 0 - blockedevery3d, - blockedevery4d, - blockedevery5d, - blockedevery6d, - blockedevery7d, - blockedevery8d, - blockedevery9d, - blockedevery10d // 8 -]; -var BLOCKED_ACCESSOR_EVERY = [ - blockedaccessorevery2d, // 0 - blockedaccessorevery3d, - blockedaccessorevery4d, - blockedaccessorevery5d, - blockedaccessorevery6d, - blockedaccessorevery7d, - blockedaccessorevery8d, - blockedaccessorevery9d, - blockedaccessorevery10d // 8 -]; -var BLOCKED_COMPLEX_EVERY = [ - blockedcomplexevery2d, // 0 - blockedcomplexevery3d, - blockedcomplexevery4d, - blockedcomplexevery5d, - blockedcomplexevery6d, - blockedcomplexevery7d, - blockedcomplexevery8d, - blockedcomplexevery9d, - blockedcomplexevery10d // 8 -]; -var MAX_DIMS = EVERY.length - 1; - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* ## Notes -* -* - A provided ndarray should be an object with the following properties: -* -* - **dtype**: data type. -* - **data**: data buffer. -* - **shape**: dimensions. -* - **strides**: stride lengths. -* - **offset**: index offset. -* - **order**: specifies whether an ndarray is row-major (C-style) or column major (Fortran-style). -* -* @param {ArrayLikeObject} arrays - array-like object containing one input array -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 3, 1, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = every( [ x ] ); -* // returns true -*/ -function every( arrays ) { - var isCmplx; - var ndims; - var xmmv; - var shx; - var iox; - var len; - var sx; - var ox; - var ns; - var x; - var d; - var i; - - // Unpack the ndarray and standardize ndarray meta data: - x = ndarray2object( arrays[ 0 ] ); - shx = x.shape; - ndims = shx.length; - - // Check for known array types which can be reinterpreted for better iteration performance... - if ( isBooleanArray( x.data ) ) { - x.data = reinterpretBoolean( x.data, 0 ); - x.accessorProtocol = false; - } else if ( isComplexArray( x.data ) ) { - x.data = reinterpretComplex( x.data, 0 ); - x.accessorProtocol = false; - x.strides = gscal( ndims, 2, x.strides, 1 ); - x.offset *= 2; - isCmplx = true; - } - // Determine whether we can avoid iteration altogether... - if ( ndims === 0 ) { - if ( x.accessorProtocol ) { - return ACCESSOR_EVERY[ ndims ]( x ); - } - if ( isCmplx ) { - return COMPLEX_EVERY[ ndims ]( x ); - } - return EVERY[ ndims ]( x ); - } - // Compute the number of elements and the number of singleton dimensions... - len = 1; // number of elements - ns = 0; // number of singleton dimensions - for ( i = 0; i < ndims; i++ ) { - d = shx[ i ]; - - // Note that, if one of the dimensions is `0`, the length will be `0`... - len *= d; - - // Check whether the current dimension is a singleton dimension... - if ( d === 1 ) { - ns += 1; - } - } - // Check whether we were provided an empty ndarray... - if ( len === 0 ) { - return true; - } - // Determine whether the ndarray is one-dimensional and thus readily translates to a one-dimensional strided array... - if ( ndims === 1 ) { - if ( x.accessorProtocol ) { - return ACCESSOR_EVERY[ ndims ]( x ); - } - if ( isCmplx ) { - return COMPLEX_EVERY[ ndims ]( x ); - } - return EVERY[ ndims ]( x ); - } - sx = x.strides; - - // Determine whether the ndarray has only **one** non-singleton dimension (e.g., ndims=4, shape=[10,1,1,1]) so that we can treat an ndarray as being equivalent to a one-dimensional strided array... - if ( ns === ndims-1 ) { - // Get the index of the non-singleton dimension... - for ( i = 0; i < ndims; i++ ) { - if ( shx[ i ] !== 1 ) { - break; - } - } - x.shape = [ shx[i] ]; - x.strides = [ sx[i] ]; - if ( x.accessorProtocol ) { - return ACCESSOR_EVERY[ 1 ]( x ); - } - if ( isCmplx ) { - return COMPLEX_EVERY[ 1 ]( x ); - } - return EVERY[ 1 ]( x ); - } - iox = iterationOrder( sx ); // +/-1 - - // Determine whether we can avoid blocked iteration... - if ( iox !== 0 ) { - // Determine the minimum and maximum linear indices which are accessible by the array view: - xmmv = minmaxViewBufferIndex( shx, sx, x.offset ); - - // Determine whether we can ignore shape (and strides) and treat the ndarray as a linear one-dimensional strided array... - if ( len === ( xmmv[1]-xmmv[0]+1 ) || ( isCmplx && len*2 === ( xmmv[1]-xmmv[0]+2 ) ) ) { // eslint-disable-line max-len - // Note: the above is equivalent to @stdlib/ndarray/base/assert/is-contiguous, but in-lined so we can retain computed values... - if ( iox === 1 ) { - ox = xmmv[ 0 ]; - } else { - ox = xmmv[ 1 ]; - } - x.shape = [ len ]; - x.strides = [ ( isCmplx ) ? iox*2 : iox ]; - x.offset = ox; - if ( x.accessorProtocol ) { - return ACCESSOR_EVERY[ 1 ]( x ); - } - if ( isCmplx ) { - return COMPLEX_EVERY[ 1 ]( x ); - } - return EVERY[ 1 ]( x ); - } - // The ndarray is non-contiguous, so we cannot directly use one-dimensional array functionality... - - // Determine whether we can use simple nested loops... - if ( ndims <= MAX_DIMS ) { - // So long as iteration always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration... - if ( x.accessorProtocol ) { - return ACCESSOR_EVERY[ ndims ]( x ); - } - if ( isCmplx ) { - return COMPLEX_EVERY[ ndims ]( x ); - } - return EVERY[ ndims ]( x ); - } - // Fall-through to blocked iteration... - } - // At this point, we're either dealing with a non-contiguous n-dimensional array or a high dimensional n-dimensional array, so our only hope is that we can still perform blocked iteration... - - // Determine whether we can perform blocked iteration... - if ( ndims <= MAX_DIMS ) { - if ( x.accessorProtocol ) { - return BLOCKED_ACCESSOR_EVERY[ ndims-2 ]( x ); - } - if ( isCmplx ) { - return BLOCKED_COMPLEX_EVERY[ ndims-2 ]( x ); - } - return BLOCKED_EVERY[ ndims-2 ]( x ); - } - // Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)... - if ( x.accessorProtocol ) { - return accessoreverynd( x ); - } - if ( isCmplx ) { - return complexeverynd( x ); - } - return everynd( x ); -} - - -// EXPORTS // - -module.exports = every; diff --git a/lib/nd.js b/lib/nd.js deleted file mode 100644 index 5f54309..0000000 --- a/lib/nd.js +++ /dev/null @@ -1,116 +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 numel = require( '@stdlib/ndarray-base-numel' ); -var vind2bind = require( '@stdlib/ndarray-base-vind2bind' ); - - -// VARIABLES // - -var MODE = 'throw'; - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 1 ]; -* -* // Define the index offset: -* var ox = 1; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'float64', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = everynd( x ); -* // returns true -*/ -function everynd( x ) { - var xbuf; - var ordx; - var len; - var sh; - var sx; - var ox; - var ix; - var i; - - sh = x.shape; - - // Compute the total number of elements over which to iterate: - len = numel( sh ); - - // Cache a reference to the output ndarray data buffer: - xbuf = x.data; - - // Cache a reference to the stride array: - sx = x.strides; - - // Cache the index of the first indexed element: - ox = x.offset; - - // Cache the array order: - ordx = x.order; - - // Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory... - for ( i = 0; i < len; i++ ) { - ix = vind2bind( sh, sx, ox, ordx, i, MODE ); - if ( !xbuf[ ix ] ) { - return false; - } - } - return true; -} - - -// EXPORTS // - -module.exports = everynd; diff --git a/lib/nd_accessors.js b/lib/nd_accessors.js deleted file mode 100644 index a3f3696..0000000 --- a/lib/nd_accessors.js +++ /dev/null @@ -1,123 +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 numel = require( '@stdlib/ndarray-base-numel' ); -var vind2bind = require( '@stdlib/ndarray-base-vind2bind' ); - - -// VARIABLES // - -var MODE = 'throw'; - - -// MAIN // - -/** -* Tests whether every element in an ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @param {Array} x.accessors - data buffer accessors -* @returns {boolean} result -* -* @example -* var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -* var accessors = require( '@stdlib/array-base-accessors' ); -* -* // Create a data buffer: -* var xbuf = toAccessorArray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 1 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'generic', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major', -* 'accessors': accessors( xbuf ).accessors -* }; -* -* // Test elements: -* var out = everynd( x ); -* // returns true -*/ -function everynd( x ) { - var xbuf; - var ordx; - var len; - var get; - var sh; - var sx; - var ox; - var ix; - var i; - - sh = x.shape; - - // Compute the total number of elements over which to iterate: - len = numel( sh ); - - // Cache a reference to the output ndarray data buffer: - xbuf = x.data; - - // Cache a reference to the stride array: - sx = x.strides; - - // Cache the index of the first indexed element: - ox = x.offset; - - // Cache the array order: - ordx = x.order; - - // Cache accessor: - get = x.accessors[ 0 ]; - - // Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory... - for ( i = 0; i < len; i++ ) { - ix = vind2bind( sh, sx, ox, ordx, i, MODE ); - if ( !get( xbuf, ix ) ) { - return false; - } - } - return true; -} - - -// EXPORTS // - -module.exports = everynd; diff --git a/lib/nd_complex.js b/lib/nd_complex.js deleted file mode 100644 index ed4dded..0000000 --- a/lib/nd_complex.js +++ /dev/null @@ -1,116 +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 numel = require( '@stdlib/ndarray-base-numel' ); -var vind2bind = require( '@stdlib/ndarray-base-vind2bind' ); - - -// VARIABLES // - -var MODE = 'throw'; - - -// MAIN // - -/** -* Tests whether every element of a reinterpreted complex number ndarray is truthy. -* -* @private -* @param {Object} x - object containing ndarray meta data -* @param {string} x.dtype - data type -* @param {Collection} x.data - data buffer -* @param {NonNegativeIntegerArray} x.shape - dimensions -* @param {IntegerArray} x.strides - stride lengths -* @param {NonNegativeInteger} x.offset - index offset -* @param {string} x.order - specifies whether `x` is row-major (C-style) or column-major (Fortran-style) -* @returns {boolean} result -* -* @example -* var Float64Array = require( '@stdlib/array-float64' ); -* -* // Create a data buffer: -* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); -* -* // Define the shape of the input array: -* var shape = [ 2, 2 ]; -* -* // Define the array strides: -* var sx = [ 4, 2 ]; -* -* // Define the index offset: -* var ox = 0; -* -* // Create the input ndarray-like object: -* var x = { -* 'dtype': 'complex128', -* 'data': xbuf, -* 'shape': shape, -* 'strides': sx, -* 'offset': ox, -* 'order': 'row-major' -* }; -* -* // Test elements: -* var out = everynd( x ); -* // returns true -*/ -function everynd( x ) { - var xbuf; - var ordx; - var len; - var sh; - var sx; - var ox; - var ix; - var i; - - sh = x.shape; - - // Compute the total number of elements over which to iterate: - len = numel( sh ); - - // Cache a reference to the output ndarray data buffer: - xbuf = x.data; - - // Cache a reference to the stride array: - sx = x.strides; - - // Cache the index of the first indexed element: - ox = x.offset; - - // Cache the array order: - ordx = x.order; - - // Iterate over each element based on the linear **view** index, regardless as to how the data is stored in memory... - for ( i = 0; i < len; i++ ) { - ix = vind2bind( sh, sx, ox, ordx, i, MODE ); - if ( !( xbuf[ ix ] || xbuf[ ix+1 ] ) ) { - return false; - } - } - return true; -} - - -// EXPORTS // - -module.exports = everynd; diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 0b8ac98..0000000 --- a/manifest.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/dispatch.c", - "./src/inline/b_x.c", - "./src/inline/c_x.c", - "./src/inline/d_x.c", - "./src/inline/f_x.c", - "./src/inline/i_x.c", - "./src/inline/k_x.c", - "./src/inline/s_x.c", - "./src/inline/t_x.c", - "./src/inline/u_x.c", - "./src/inline/x_x.c", - "./src/inline/z_x.c", - "./src/internal/permute.c", - "./src/internal/range.c", - "./src/internal/sort2ins.c", - "./src/predicate/b_x.c", - "./src/predicate/b_x_as_c_x.c", - "./src/predicate/b_x_as_d_x.c", - "./src/predicate/b_x_as_f_x.c", - "./src/predicate/b_x_as_i_x.c", - "./src/predicate/b_x_as_k_x.c", - "./src/predicate/b_x_as_t_x.c", - "./src/predicate/b_x_as_u_x.c", - "./src/predicate/b_x_as_z_x.c", - "./src/predicate/c_x.c", - "./src/predicate/c_x_as_z_x.c", - "./src/predicate/d_x.c", - "./src/predicate/d_x_as_z_x.c", - "./src/predicate/f_x.c", - "./src/predicate/f_x_as_c_x.c", - "./src/predicate/f_x_as_d_x.c", - "./src/predicate/f_x_as_z_x.c", - "./src/predicate/i_x.c", - "./src/predicate/i_x_as_d_x.c", - "./src/predicate/i_x_as_z_x.c", - "./src/predicate/k_x.c", - "./src/predicate/k_x_as_c_x.c", - "./src/predicate/k_x_as_d_x.c", - "./src/predicate/k_x_as_f_x.c", - "./src/predicate/k_x_as_i_x.c", - "./src/predicate/k_x_as_z_x.c", - "./src/predicate/s_x.c", - "./src/predicate/s_x_as_c_x.c", - "./src/predicate/s_x_as_d_x.c", - "./src/predicate/s_x_as_f_x.c", - "./src/predicate/s_x_as_i_x.c", - "./src/predicate/s_x_as_k_x.c", - "./src/predicate/s_x_as_z_x.c", - "./src/predicate/t_x.c", - "./src/predicate/t_x_as_c_x.c", - "./src/predicate/t_x_as_d_x.c", - "./src/predicate/t_x_as_f_x.c", - "./src/predicate/t_x_as_i_x.c", - "./src/predicate/t_x_as_u_x.c", - "./src/predicate/t_x_as_z_x.c", - "./src/predicate/u_x.c", - "./src/predicate/u_x_as_d_x.c", - "./src/predicate/u_x_as_z_x.c", - "./src/predicate/x_x.c", - "./src/predicate/z_x.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex-float32-ctor", - "@stdlib/complex-float32-real", - "@stdlib/complex-float32-imag", - "@stdlib/complex-float64-ctor", - "@stdlib/complex-float64-real", - "@stdlib/complex-float64-imag", - "@stdlib/ndarray-base-bytes-per-element", - "@stdlib/ndarray-base-iteration-order", - "@stdlib/ndarray-base-vind2bind", - "@stdlib/ndarray-ctor", - "@stdlib/ndarray-index-modes", - "@stdlib/ndarray-orders" - ] - } - ] -} diff --git a/package.json b/package.json index 732bff1..a7726af 100644 --- a/package.json +++ b/package.json @@ -3,34 +3,7 @@ "version": "0.1.1", "description": "Test whether every element in an ndarray is truthy.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "scripts": "./scripts", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "main": "./index.js", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -39,88 +12,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-assert-is-booleanarray": "^0.0.3", - "@stdlib/array-base-assert-is-complex-typed-array": "^0.1.3", - "@stdlib/blas-base-gscal": "^0.3.1", - "@stdlib/complex-float32-ctor": "^0.1.1", - "@stdlib/complex-float32-imag": "^0.1.2", - "@stdlib/complex-float32-real": "^0.1.2", - "@stdlib/complex-float64-ctor": "^0.1.2", - "@stdlib/complex-float64-imag": "^0.1.2", - "@stdlib/complex-float64-real": "^0.1.2", - "@stdlib/ndarray-base-bytes-per-element": "^0.3.1", - "@stdlib/ndarray-base-iteration-order": "^0.2.3", - "@stdlib/ndarray-base-minmax-view-buffer-index": "^0.2.3", - "@stdlib/ndarray-base-ndarraylike2object": "^0.2.3", - "@stdlib/ndarray-base-nullary-loop-interchange-order": "^0.2.3", - "@stdlib/ndarray-base-nullary-tiling-block-size": "^0.2.3", - "@stdlib/ndarray-base-numel": "^0.2.3", - "@stdlib/ndarray-base-strides2order": "^0.2.3", - "@stdlib/ndarray-base-vind2bind": "^0.2.3", - "@stdlib/ndarray-ctor": "^0.3.1", - "@stdlib/ndarray-index-modes": "^0.2.3", - "@stdlib/ndarray-orders": "^0.2.3", - "@stdlib/strided-base-reinterpret-boolean": "^0.0.3", - "@stdlib/strided-base-reinterpret-complex": "^0.1.3", - "@stdlib/types": "^0.5.1", - "@stdlib/utils-library-manifest": "^0.2.4" - }, - "devDependencies": { - "@stdlib/array-base-to-accessor-array": "^0.2.3", - "@stdlib/array-filled": "^0.3.1", - "@stdlib/array-float64": "^0.2.3", - "@stdlib/array-ones": "^0.2.2", - "@stdlib/array-typed-complex-ctors": "^0.2.3", - "@stdlib/array-zeros": "^0.2.3", - "@stdlib/assert-is-boolean": "^0.2.3", - "@stdlib/fs-read-dir": "^0.2.3", - "@stdlib/fs-read-file": "^0.2.3", - "@stdlib/fs-read-json": "^0.2.4", - "@stdlib/fs-unlink": "^0.2.3", - "@stdlib/fs-write-file": "^0.2.3", - "@stdlib/math-base-special-cbrt": "^0.2.3", - "@stdlib/math-base-special-floor": "^0.2.4", - "@stdlib/math-base-special-pow": "^0.3.1", - "@stdlib/math-base-special-sqrt": "^0.2.3", - "@stdlib/ndarray-base-char2dtype": "^0.2.3", - "@stdlib/ndarray-base-dtype-char": "^0.3.1", - "@stdlib/ndarray-base-dtype-desc": "^0.3.1", - "@stdlib/ndarray-base-dtype2c": "^0.3.1", - "@stdlib/ndarray-base-shape2strides": "^0.2.3", - "@stdlib/ndarray-base-strides2offset": "^0.2.3", - "@stdlib/ndarray-base-to-array": "^0.2.2", - "@stdlib/ndarray-dtypes": "^0.4.1", - "@stdlib/ndarray-from-scalar": "^0.3.1", - "@stdlib/ndarray-safe-casts": "^0.4.1", - "@stdlib/random-array-bernoulli": "^0.2.2", - "@stdlib/random-array-discrete-uniform": "^0.2.2", - "@stdlib/string-format": "^0.2.3", - "@stdlib/string-replace": "^0.2.3", - "@stdlib/string-substring-after": "^0.2.3", - "@stdlib/string-substring-before": "^0.2.3", - "@stdlib/string-uppercase": "^0.3.1", - "@stdlib/time-current-year": "^0.2.3", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.3" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "base", diff --git a/scripts/inline_loops.js b/scripts/inline_loops.js deleted file mode 100644 index f210c3b..0000000 --- a/scripts/inline_loops.js +++ /dev/null @@ -1,557 +0,0 @@ -#!/usr/bin/env node - -/** -* @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 path = require( 'path' ); -var logger = require( 'debug' ); -var readFile = require( '@stdlib/fs-read-file' ).sync; -var readJSON = require( '@stdlib/fs-read-json' ).sync; -var writeFile = require( '@stdlib/fs-write-file' ).sync; -var replace = require( '@stdlib/string-replace' ); -var substringBefore = require( '@stdlib/string-substring-before' ); -var substringAfter = require( '@stdlib/string-substring-after' ); -var uppercase = require( '@stdlib/string-uppercase' ); -var dtypeChar = require( '@stdlib/ndarray-base-dtype-char' ); -var dtype2c = require( '@stdlib/ndarray-base-dtype2c' ); -var char2dtype = require( '@stdlib/ndarray-base-char2dtype' ); -var bytesPerElement = require( '@stdlib/ndarray-base-bytes-per-element' ); -var currentYear = require( '@stdlib/time-current-year' ); -var removeFilesByRegExp = require( './lib/remove_files.js' ); -var defineStrides = require( './lib/define_strides.js' ); -var defineShapes = require( './lib/define_shapes.js' ); -var defineByteArrays = require( './lib/define_byte_arrays.js' ); -var DTYPES = require( './lib/dtypes.js' ); - - -// VARIABLES // - -var FOPTS = { - 'encoding': 'utf8' -}; - -// Logger: -var debug = logger( 'ndarray-every-inline-loops:script' ); - -// Get the current year: -var CURRENT_YEAR = currentYear().toString(); - -// Specify the copyright holder: -var COPYRIGHT = 'The Stdlib Authors'; - -// Templates: -var TMPL_HEADER = readFile( path.join( __dirname, 'templates', 'inline', 'header.txt' ), FOPTS ); -var TMPL_SOURCE = readFile( path.join( __dirname, 'templates', 'inline', 'source.txt' ), FOPTS ); -var TMPL_README = readFile( path.join( __dirname, 'templates', 'inline', 'docs.txt' ), FOPTS ); - -// Output directories: -var INCLUDE_DIR = path.resolve( __dirname, '..', 'include', 'stdlib', 'ndarray', 'base', 'every' ); -var SRC_DIR = path.resolve( __dirname, '..', 'src', 'inline' ); - -// Main header file: -var INCLUDE_MAIN = INCLUDE_DIR + '.h'; - -// Manifest file: -var MANIFEST = path.resolve( __dirname, '..', 'manifest.json' ); - -// README file: -var README = path.resolve( __dirname, '..', 'README.md' ); - -// Define "special" loops, which cannot be readily generated according to standardized rules: -var SPECIAL_LOOPS = []; - -// Regular expression to test for a "loop" file: -var RE_LOOP_FILE = /^[a-z]_[a-z]\.(?:h|c)$/; - -// Regular expression to test for a "loop" file in the manifest.json: -var RE_MANIFEST_LOOP_FILE = /\.\/src\/inline\/[a-z]_[a-z]\.c$/; - -// Regular expression to match input and output array dtype characters: -var RE_SIGNATURE = /^([a-z])_([a-z])/; - -// Specify array shapes: -var SHAPES = [ - [], - [ 3 ], - [ 2, 2 ], - [ 2, 2, 2 ], - [ 1, 2, 2, 2 ], - [ 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 1, 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 ] -]; - -// Array order: -var ORDER = 'row-major'; - -// Inline expressions: -var INLINE_EXPRESSIONS_0D = { - 'bool': 'v', - 'float64': '( v != 0.0 )', - 'float32': '( v != 0.0f )', - 'complex128': '( stdlib_complex128_real( v ) != 0.0 || stdlib_complex128_imag( v ) != 0.0 )', - 'complex64': '( stdlib_complex64_real( v ) != 0.0f || stdlib_complex64_imag( v ) != 0.0f )', - 'default': '( v != 0 )' // WARNING: assumes an integer dtype! -}; -var INLINE_EXPRESSIONS = { - 'bool': 'in1', - 'float64': '( in1 != 0.0 )', - 'float32': '( in1 != 0.0f )', - 'complex128': '( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 )', - 'complex64': '( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f )', - 'default': '( in1 != 0 )' // WARNING: assumes an integer dtype! -}; - - -// FUNCTIONS // - -/** -* Generates a list of loop signatures from a list of data types. -* -* @private -* @param {StringArray} dtypes - list of data types -* @returns {StringArray} list of loop signatures -*/ -function signatures( dtypes ) { - var out; - var ch1; - var t1; - var N; - var s; - var i; - - N = dtypes.length; - - // Generate the list of signatures: - out = []; - for ( i = 0; i < N; i++ ) { - t1 = dtypes[ i ]; - - // Resolve single-letter dtype abbreviation: - ch1 = dtypeChar( t1 ); - - // Generate the input/output array signature: - s = ch1+'_x'; // e.g., d_x - out.push( s ); - } - // Append any special loops: - for ( i = 0; i < SPECIAL_LOOPS.length; i++ ) { - out.push( SPECIAL_LOOPS[ i ] ); - } - return out.sort(); -} - -/** -* Creates a header file for a provided loop signature. -* -* @private -* @param {string} signature - loop signature -* @throws {Error} unexpected error -*/ -function createHeaderFile( signature ) { - var fpath; - var file; - var err; - - file = replace( TMPL_HEADER, '{{YEAR}}', CURRENT_YEAR ); - file = replace( file, '{{COPYRIGHT}}', COPYRIGHT ); - file = replace( file, '{{INCLUDE_GUARD}}', uppercase( signature ) ); - file = replace( file, '{{SIGNATURE}}', signature ); - - fpath = path.join( INCLUDE_DIR, 'inline', signature+'.h' ); - - debug( 'Creating header file: %s', fpath ); - err = writeFile( fpath, file, FOPTS ); - if ( err ) { - throw err; - } -} - -/** -* Creates header files for a list of loop signatures. -* -* @private -* @param {StringArray} signatures - list of loop signatures -*/ -function createHeaderFiles( signatures ) { - var i; - for ( i = 0; i < signatures.length; i++ ) { - createHeaderFile( signatures[ i ] ); - } -} - -/** -* Creates a source file for a provided loop signature. -* -* @private -* @param {string} signature - loop signature -* @throws {Error} unexpected error -*/ -function createSourceFile( signature ) { - var match1; - var fpath; - var file; - var args; - var err; - var inc; - var tmp; - var ch1; - var ct1; - var nb1; - var t1; - - file = replace( TMPL_SOURCE, '{{YEAR}}', CURRENT_YEAR ); - file = replace( file, '{{COPYRIGHT}}', COPYRIGHT ); - file = replace( file, '{{SIGNATURE}}', signature ); - - // Ensure the appropriate header files are included in source files: - inc = []; - if ( /c/.test( signature ) ) { - inc.push( '#include "stdlib/complex/float32/ctor.h"' ); - inc.push( '#include "stdlib/complex/float32/real.h"' ); - inc.push( '#include "stdlib/complex/float32/imag.h"' ); - } - if ( /z/.test( signature ) ) { - inc.push( '#include "stdlib/complex/float64/ctor.h"' ); - inc.push( '#include "stdlib/complex/float64/real.h"' ); - inc.push( '#include "stdlib/complex/float64/imag.h"' ); - } - if ( inc.length ) { - file = replace( file, '{{INCLUDES}}', '\n'+inc.join( '\n' ) ); - } else { - file = replace( file, '{{INCLUDES}}', '' ); - } - // Ensure the appropriate header files are included in source documentation examples: - inc = []; - tmp = signature.substring( 0, 1 ); - if ( /c/.test( tmp ) ) { - inc.push( '#include "stdlib/complex/float32/ctor.h"' ); - } - if ( /z/.test( tmp ) ) { - inc.push( '#include "stdlib/complex/float64/ctor.h"' ); - } - if ( inc.length ) { - file = replace( file, '{{EXAMPLE_INCLUDES}}', '\n* '+inc.join( '\n* ' ) ); - } else { - file = replace( file, '{{EXAMPLE_INCLUDES}}', '' ); - } - // Resolve the array data types: - match1 = signature.match( RE_SIGNATURE ); - ch1 = match1[ 1 ]; - t1 = char2dtype( ch1 ); - ct1 = dtype2c( t1 ); - - // Define array data types: - file = replace( file, '{{INPUT_NDARRAY_1_DTYPE_UPPER}}', uppercase( t1 ) ); - file = replace( file, '{{INPUT_NDARRAY_1_DTYPE_LOWER}}', t1 ); - - // Define the input array C data type: - file = replace( file, '{{INPUT_NDARRAY_1_CTYPE}}', dtype2c( t1 ) ); - - // Define the number of bytes per element for the respective arrays: - nb1 = bytesPerElement( t1 ); - file = replace( file, '{{INPUT_NDARRAY_1_BYTES_PER_ELEMENT}}', nb1.toString() ); - - // Define the array shapes: - file = defineShapes( file, SHAPES ); - - // Define underlying byte arrays: - file = defineByteArrays( file, SHAPES, nb1 ); - - // Define array strides: - file = defineStrides( file, SHAPES, nb1, ORDER ); - - // Resolve the inline expression for zero-dimensional input ndarrays: - tmp = INLINE_EXPRESSIONS_0D[ t1 ]; - if ( tmp === void 0 ) { - tmp = INLINE_EXPRESSIONS_0D.default; - } - file = replace( file, '{{INLINE_EXPRESSION_0D}}', tmp ); - - // Resolve the loop macro arguments: - args = [ ct1 ]; - tmp = INLINE_EXPRESSIONS[ t1 ]; - if ( tmp === void 0 ) { - tmp = INLINE_EXPRESSIONS.default; - } - args.push( tmp ); - file = replace( file, '{{INLINE_LOOP_MACRO_ARGUMENTS}}', args.join( ', ' ) ); - - // Create the source file: - fpath = path.join( SRC_DIR, signature+'.c' ); - debug( 'Creating source file: %s', fpath ); - err = writeFile( fpath, file, FOPTS ); - if ( err ) { - throw err; - } -} - -/** -* Creates source files for a list of loop signatures. -* -* @private -* @param {StringArray} signatures - list of loop signatures -*/ -function createSourceFiles( signatures ) { - var i; - for ( i = 0; i < signatures.length; i++ ) { - createSourceFile( signatures[ i ] ); - } -} - -/** -* Generates README documentation for a loop interface. -* -* @private -* @param {string} signature - loop signature -* @returns {string} documentation -*/ -function createDoc( signature ) { - var match; - var inc; - var doc; - var ch1; - var tmp; - var nb1; - var t1; - - doc = replace( TMPL_README, '{{SIGNATURE}}', signature ); - - // Ensure appropriate header files are included in documentation examples: - inc = []; - tmp = signature.substring( 0, 1 ); - if ( /c/.test( tmp ) ) { - inc.push( '#include "stdlib/complex/float32/ctor.h"' ); - } - if ( /z/.test( tmp ) ) { - inc.push( '#include "stdlib/complex/float64/ctor.h"' ); - } - if ( inc.length ) { - doc = replace( doc, '{{EXAMPLE_INCLUDES}}', '\n'+inc.join( '\n' ) ); - } else { - doc = replace( doc, '{{EXAMPLE_INCLUDES}}', '' ); - } - // Resolve the array data types: - match = signature.match( RE_SIGNATURE ); - ch1 = match[ 1 ]; - t1 = char2dtype( ch1 ); - - // Define array data types: - doc = replace( doc, '{{INPUT_NDARRAY_1_DTYPE_UPPER}}', uppercase( t1 ) ); - - // Define the number of bytes per element for the respective arrays: - nb1 = bytesPerElement( t1 ); - doc = replace( doc, '{{INPUT_NDARRAY_1_BYTES_PER_ELEMENT}}', nb1.toString() ); - - // Define the array shapes: - doc = defineShapes( doc, SHAPES ); - - // Define underlying byte arrays: - doc = defineByteArrays( doc, SHAPES, nb1 ); - - // Define array strides: - doc = defineStrides( doc, SHAPES, nb1, ORDER ); - - return doc; -} - -/** -* Update the package README. -* -* @private -* @param {StringArray} signatures - list of (sorted) loop signatures -* @throws {Error} unexpected error -*/ -function updateREADME( signatures ) { - var parts; - var file; - var docs; - var out; - var err; - var i; - - file = readFile( README, FOPTS ); - if ( file instanceof Error ) { - throw file; - } - docs = []; - for ( i = 0; i < signatures.length; i++ ) { - docs.push( createDoc( signatures[ i ] ) ); - } - out = []; - parts = file.split( '\n' ); - out.push( parts[ 0 ] ); - out.push( '' ); - out.push( '' ); - out.push( docs.join( '\n' ) ); - - parts = parts[ 1 ].split( '\n' ); - out.push( '' ); - out.push( parts[ 1 ] ); - - err = writeFile( README, out.join( '\n' ), FOPTS ); - if ( err ) { - throw err; - } -} - -/** -* Updates the main header file. -* -* @private -* @param {StringArray} signatures - list of (sorted) loop signatures -* @throws {Error} unexpected error -*/ -function updateMainHeader( signatures ) { - var file; - var list; - var err; - var sig; - var ch; - var i; - - file = readFile( INCLUDE_MAIN, FOPTS ); - if ( file instanceof Error ) { - throw file; - } - list = []; - ch = signatures[ 0 ].charAt( 0 ); - for ( i = 0; i < signatures.length; i++ ) { - sig = signatures[ i ]; - if ( sig.charAt( 0 ) !== ch ) { - ch = sig.charAt( 0 ); - list.push( '' ); - } - list.push( '#include "every/inline/'+sig+'.h"' ); - } - file = [ - substringBefore( file, '\n// BEGIN INLINE LOOPS' ), - '// BEGIN INLINE LOOPS', - list.join( '\n' ), - '// END INLINE LOOPS', - substringAfter( file, '// END INLINE LOOPS\n' ) - ].join( '\n' ); - - err = writeFile( INCLUDE_MAIN, file, FOPTS ); - if ( err ) { - throw err; - } -} - -/** -* Updates the package manifest. -* -* @private -* @param {StringArray} signatures - list of (sorted) loop signatures -* @throws {Error} unexpected error -*/ -function updateManifest( signatures ) { - var file; - var list; - var tmp; - var err; - var l; - var i; - var j; - - file = readJSON( MANIFEST, FOPTS ); - if ( file instanceof Error ) { - throw file; - } - list = []; - for ( i = 0; i < signatures.length; i++ ) { - list.push( './src/inline/'+signatures[ i ]+'.c' ); - } - for ( j = 0; j < file.confs.length; j++ ) { - l = list.slice(); - - // Copy over non-signature source files... - tmp = file.confs[ j ].src; - for ( i = 0; i < tmp.length; i++ ) { - if ( RE_MANIFEST_LOOP_FILE.test( tmp[ i ] ) === false ) { - l.push( tmp[ i ] ); - } - } - l.sort(); - - // Replace the list of source files: - file.confs[ j ].src = l; - } - err = writeFile( MANIFEST, JSON.stringify( file, null, 2 )+'\n', FOPTS ); - if ( err ) { - throw err; - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var sigs; - var dir; - - debug( 'Data types: %s', DTYPES.join( ', ' ) ); - - // Generate the list of loop signatures: - sigs = signatures( DTYPES ); - debug( 'Signatures: %s', '\n'+sigs.join( '\n' ) ); - - // Remove loop files from output directories: - dir = path.join( INCLUDE_DIR, 'inline' ); - debug( 'Clearing include directory: %s', dir ); - removeFilesByRegExp( dir, RE_LOOP_FILE ); - - debug( 'Clearing source directory: %s', SRC_DIR ); - removeFilesByRegExp( SRC_DIR, RE_LOOP_FILE ); - - // Create header files for the list of loop signatures: - debug( 'Creating header files...' ); - createHeaderFiles( sigs ); - - // Create source files for the list of loop signatures: - debug( 'Creating source files...' ); - createSourceFiles( sigs ); - - // Update the main header file to include the loop header files: - debug( 'Updating main header file: %s', INCLUDE_MAIN ); - updateMainHeader( sigs ); - - // Update the package manifest to include the loop source files: - debug( 'Updating manifest file: %s', MANIFEST ); - updateManifest( sigs ); - - // Update the package README to include the loop interfaces: - debug( 'Updating README file: %s', README ); - updateREADME( sigs ); - - debug( 'Finished.' ); -} - -main(); diff --git a/scripts/lib/define_byte_arrays.js b/scripts/lib/define_byte_arrays.js deleted file mode 100644 index ed9cdc7..0000000 --- a/scripts/lib/define_byte_arrays.js +++ /dev/null @@ -1,61 +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 numel = require( '@stdlib/ndarray-base-numel' ); -var filledarray = require( '@stdlib/array-filled' ); -var replace = require( '@stdlib/string-replace' ); - - -// MAIN // - -/** -* Defines byte arrays in a provided template string. -* -* @private -* @param {string} tmpl - template string -* @param {Array} shapes - array of shape arrays -* @param {PositiveInteger} nb1 - bytes per element for output array -* @returns {string} updated string -*/ -function defineByteArrays( tmpl, shapes, nb1 ) { - var bytes; - var tmp; - var N; - var i; - - bytes = filledarray( 0, nb1, 'generic' ).join( ', ' ); - tmpl = replace( tmpl, '{{INPUT_NDARRAY_1_BYTES_0D}}', bytes ); - - for ( i = 1; i < shapes.length; i++ ) { - N = numel( shapes[ i ] ); - - tmp = '{{INPUT_NDARRAY_1_BYTES_'+i+'D}}'; - bytes = filledarray( 0, nb1*N, 'generic' ).join( ', ' ); - tmpl = replace( tmpl, tmp, bytes ); - } - return tmpl; -} - - -// EXPORTS // - -module.exports = defineByteArrays; diff --git a/scripts/lib/define_shapes.js b/scripts/lib/define_shapes.js deleted file mode 100644 index f9df6be..0000000 --- a/scripts/lib/define_shapes.js +++ /dev/null @@ -1,47 +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 replace = require( '@stdlib/string-replace' ); - - -// MAIN // - -/** -* Defines array shapes in a provided template string. -* -* @private -* @param {string} tmpl - template string -* @param {Array} shapes - array of shape arrays -* @returns {string} updated string -*/ -function defineShapes( tmpl, shapes ) { - var i; - for ( i = 1; i < shapes.length; i++ ) { - tmpl = replace( tmpl, '{{NDARRAY_SHAPE_'+i+'D}}', shapes[ i ].join( ', ' ) ); - } - return tmpl; -} - - -// EXPORTS // - -module.exports = defineShapes; diff --git a/scripts/lib/define_strides.js b/scripts/lib/define_strides.js deleted file mode 100644 index eff8f60..0000000 --- a/scripts/lib/define_strides.js +++ /dev/null @@ -1,59 +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 shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var gscal = require( '@stdlib/blas-base-gscal' ); -var replace = require( '@stdlib/string-replace' ); - - -// MAIN // - -/** -* Defines array strides in a provided template string. -* -* @private -* @param {string} tmpl - template string -* @param {Array} shapes - array of shape arrays -* @param {PositiveInteger} nb1 - bytes per element for the first array -* @param {string} order - memory layout order -* @returns {string} updated string -*/ -function defineStrides( tmpl, shapes, nb1, order ) { - var strides; - var tmp; - var st; - var i; - - for ( i = 1; i < shapes.length; i++ ) { - strides = shape2strides( shapes[ i ], order ); - - tmp = '{{INPUT_NDARRAY_1_STRIDES_'+i+'D}}'; - st = gscal( strides.length, nb1, strides.slice(), 1 ); - tmpl = replace( tmpl, tmp, st.join( ', ' ) ); - } - return tmpl; -} - - -// EXPORTS // - -module.exports = defineStrides; diff --git a/scripts/lib/dtypes.js b/scripts/lib/dtypes.js deleted file mode 100644 index 48e5397..0000000 --- a/scripts/lib/dtypes.js +++ /dev/null @@ -1,36 +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 dtypes = require( '@stdlib/ndarray-dtypes' ); -var filter = require( './filter.js' ); -var EXCLUDE_DTYPES = require( './exclude_dtypes.js' ); - - -// MAIN // - -// Resolve a list of dtypes for which we want to create loops: -var DTYPES = filter( dtypes(), EXCLUDE_DTYPES ).sort(); - - -// EXPORTS // - -module.exports = DTYPES; diff --git a/scripts/lib/exclude_dtypes.js b/scripts/lib/exclude_dtypes.js deleted file mode 100644 index d9f2314..0000000 --- a/scripts/lib/exclude_dtypes.js +++ /dev/null @@ -1,29 +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'; - -// MAIN // - -// Data types to exclude when generating loops: -var EXCLUDE_DTYPES = [ 'binary', 'generic', 'uint8c' ]; - - -// EXPORTS // - -module.exports = EXCLUDE_DTYPES; diff --git a/scripts/lib/filter.js b/scripts/lib/filter.js deleted file mode 100644 index 8ee7ca2..0000000 --- a/scripts/lib/filter.js +++ /dev/null @@ -1,67 +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'; - -// MAIN // - -/** -* Removes a list of elements from a provided list. -* -* @private -* @param {ArrayLikeObject} src - list to filter -* @param {ArrayLikeObject} list - items to remove -* @returns {ArrayLikeObject} filtered list -* -* @example -* var src = [ 'a', 'b', 'c', 'd' ]; -* var list = [ 'b', 'd' ]; -* -* var out = filter( src, list ); -* // returns [ 'a', 'c' ] -*/ -function filter( src, list ) { // TODO: replace with a `@stdlib/array/base/*` utility performing the equivalent set operation - var out; - var M; - var N; - var v; - var i; - var j; - - M = src.length; - N = list.length; - - out = []; - for ( i = 0; i < M; i++ ) { - v = src[ i ]; - for ( j = 0; j < N; j++ ) { - if ( v === list[ j ] ) { - break; - } - } - if ( j === N ) { - out.push( v ); - } - } - return out; -} - - -// EXPORTS // - -module.exports = filter; diff --git a/scripts/lib/is_complex_char.js b/scripts/lib/is_complex_char.js deleted file mode 100644 index f0c4b5c..0000000 --- a/scripts/lib/is_complex_char.js +++ /dev/null @@ -1,41 +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'; - -// MAIN // - -/** -* Tests whether a one-letter character abbreviation corresponds to a complex number data type. -* -* @private -* @param {string} ch - one-letter character abbreviation -* @returns {boolean} test result -* -* @example -* var bool = isComplexChar( 'z' ); -* // returns true -*/ -function isComplexChar( ch ) { - return ( ch === 'c' || ch === 'z' ); -} - - -// EXPORTS // - -module.exports = isComplexChar; diff --git a/scripts/lib/remove_files.js b/scripts/lib/remove_files.js deleted file mode 100644 index 4a54a74..0000000 --- a/scripts/lib/remove_files.js +++ /dev/null @@ -1,52 +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 path = require( 'path' ); -var readDir = require( '@stdlib/fs-read-dir' ).sync; -var unlink = require( '@stdlib/fs-unlink' ).sync; - - -// MAIN // - -/** -* Removes files from a directory which match a provided regular expression. -* -* @private -* @param {string} dir - directory -* @param {RegExp} re - regular expression to test whether a file should be removed -*/ -function removeFilesByRegExp( dir, re ) { // TODO: create a `@stdlib/fs/*` utility package for this - var list; - var i; - - list = readDir( dir ); - for ( i = 0; i < list.length; i++ ) { - if ( re.test( list[ i ] ) ) { - unlink( path.join( dir, list[ i ] ) ); - } - } -} - - -// EXPORTS // - -module.exports = removeFilesByRegExp; diff --git a/scripts/loops.js b/scripts/loops.js deleted file mode 100644 index 8bca2c8..0000000 --- a/scripts/loops.js +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env node - -/** -* @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 path = require( 'path' ); -var logger = require( 'debug' ); -var readFile = require( '@stdlib/fs-read-file' ).sync; -var writeFile = require( '@stdlib/fs-write-file' ).sync; -var dtypeChar = require( '@stdlib/ndarray-base-dtype-char' ); -var dtypeDesc = require( '@stdlib/ndarray-base-dtype-desc' ); -var DTYPES = require( './lib/dtypes.js' ); - - -// VARIABLES // - -var FOPTS = { - 'encoding': 'utf8' -}; - -// Logger: -var debug = logger( 'ndarray-every-loops:script' ); - -// README file: -var README = path.resolve( __dirname, '..', 'README.md' ); - - -// FUNCTIONS // - -/** -* Returns a character code list item. -* -* @private -* @param {string} dtype - data type -* @returns {string} list item -*/ -function charCodeListItem( dtype ) { - return [ - '- **', - dtypeChar( dtype ), - '**: `', - dtype, - '` (', - dtypeDesc( dtype ), - ').' - ].join( '' ); -} - -/** -* Returns a list of character code descriptions. -* -* @private -* @param {StringArray} dtypes - list of data types -* @returns {StringArray} list of character code descriptions -*/ -function charCodeList( dtypes ) { - var out; - var i; - - out = []; - for ( i = 0; i < dtypes.length; i++ ) { - out.push( charCodeListItem( dtypes[ i ] ) ); - } - return out; -} - -/** -* Update the package README. -* -* @private -* @throws {Error} unexpected error -*/ -function updateREADME() { - var parts; - var file; - var out; - var err; - - file = readFile( README, FOPTS ); - if ( file instanceof Error ) { - throw file; - } - out = []; - parts = file.split( '\n' ); - out.push( parts[ 0 ] ); - out.push( '' ); - out.push( '' ); - out.push( charCodeList( DTYPES ).join( '\n' ) ); - out.push( '' ); - - parts = parts[ 1 ].split( '\n' ); - out.push( '' ); - out.push( parts[ 1 ] ); - - err = writeFile( README, out.join( '\n' ), FOPTS ); - if ( err ) { - throw err; - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - debug( 'Updating README file: %s', README ); - updateREADME(); -} - -require( './predicate_loops.js' ); // eslint-disable-line stdlib/no-unassigned-require -require( './inline_loops.js' ); // eslint-disable-line stdlib/no-unassigned-require -main(); diff --git a/scripts/predicate_loops.js b/scripts/predicate_loops.js deleted file mode 100644 index a05f008..0000000 --- a/scripts/predicate_loops.js +++ /dev/null @@ -1,645 +0,0 @@ -#!/usr/bin/env node - -/** -* @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 path = require( 'path' ); -var logger = require( 'debug' ); -var readFile = require( '@stdlib/fs-read-file' ).sync; -var readJSON = require( '@stdlib/fs-read-json' ).sync; -var writeFile = require( '@stdlib/fs-write-file' ).sync; -var replace = require( '@stdlib/string-replace' ); -var substringBefore = require( '@stdlib/string-substring-before' ); -var substringAfter = require( '@stdlib/string-substring-after' ); -var uppercase = require( '@stdlib/string-uppercase' ); -var safeCasts = require( '@stdlib/ndarray-safe-casts' ); -var dtypeChar = require( '@stdlib/ndarray-base-dtype-char' ); -var dtype2c = require( '@stdlib/ndarray-base-dtype2c' ); -var char2dtype = require( '@stdlib/ndarray-base-char2dtype' ); -var bytesPerElement = require( '@stdlib/ndarray-base-bytes-per-element' ); -var currentYear = require( '@stdlib/time-current-year' ); -var format = require( '@stdlib/string-format' ); -var isComplexChar = require( './lib/is_complex_char.js' ); -var filter = require( './lib/filter.js' ); -var defineStrides = require( './lib/define_strides.js' ); -var defineShapes = require( './lib/define_shapes.js' ); -var defineByteArrays = require( './lib/define_byte_arrays.js' ); -var removeFilesByRegExp = require( './lib/remove_files.js' ); -var EXCLUDE_DTYPES = require( './lib/exclude_dtypes.js' ); -var DTYPES = require( './lib/dtypes.js' ); - - -// VARIABLES // - -var FOPTS = { - 'encoding': 'utf8' -}; - -// Logger: -var debug = logger( 'ndarray-every-predicate-loops:script' ); - -// Get the current year: -var CURRENT_YEAR = currentYear().toString(); - -// Specify the copyright holder: -var COPYRIGHT = 'The Stdlib Authors'; - -// Templates: -var TMPL_HEADER = readFile( path.join( __dirname, 'templates', 'predicate', 'header.txt' ), FOPTS ); -var TMPL_SOURCE = readFile( path.join( __dirname, 'templates', 'predicate', 'source.txt' ), FOPTS ); -var TMPL_README = readFile( path.join( __dirname, 'templates', 'predicate', 'docs.txt' ), FOPTS ); - -// Output directories: -var INCLUDE_DIR = path.resolve( __dirname, '..', 'include', 'stdlib', 'ndarray', 'base', 'every' ); -var SRC_DIR = path.resolve( __dirname, '..', 'src', 'predicate' ); - -// Main header file: -var INCLUDE_MAIN = INCLUDE_DIR + '.h'; - -// Manifest file: -var MANIFEST = path.resolve( __dirname, '..', 'manifest.json' ); - -// README file: -var README = path.resolve( __dirname, '..', 'README.md' ); - -// Define "special" loops, which cannot be readily generated according to standardized rules: -var SPECIAL_LOOPS = []; - -// Hash containing C macro names: -var MACROS = { - 'default': 'CLBK', - 'cast': 'CLBK_ARG_CAST', - 'acast': 'CLBK_ARG_CAST_FCN' -}; - -// Regular expression to test for a "loop" file: -var RE_LOOP_FILE = /^[a-z]_[a-z](?:_as_[a-z]_[a-z]|)\.(?:h|c)$/; - -// Regular expression to test for a "loop" file in the manifest.json: -var RE_MANIFEST_LOOP_FILE = /\.\/src\/predicate\/[a-z]_[a-z](?:_as_[a-z]_[a-z]|)\.c$/; - -// Regular expression to match input and output array dtype characters: -var RE_SIGNATURE = /^([a-z])_([a-z])/; - -// Regular expression to match callback dtype characters: -var RE_CALLBACK = /_as_([a-z])_([a-z])$/; - -// Specify array shapes: -var SHAPES = [ - [], - [ 3 ], - [ 2, 2 ], - [ 2, 2, 2 ], - [ 1, 2, 2, 2 ], - [ 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 1, 1, 1, 2, 2, 2 ], - [ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 ] -]; - -// Array order: -var ORDER = 'row-major'; - - -// FUNCTIONS // - -/** -* Returns a callback body based on an output data type. -* -* @private -* @param {string} ch1 - one-letter character abbreviation for output data type -* @returns {string} callback body -*/ -function callbackBody( ch1 ) { - if ( ch1 === 'c' ) { - return 'return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f );'; - } - if ( ch1 === 'z' ) { - return 'return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 );'; - } - if ( ch1 === 'x' ) { - return 'return x;'; - } - if ( ch1 === 'd' ) { - return 'return x == 0.0;'; - } - if ( ch1 === 'f' ) { - return 'return x == 0.0f;'; - } - return 'return x == 0;'; -} - -/** -* Generates a list of loop signatures from a list of data types. -* -* @private -* @param {StringArray} dtypes - list of data types -* @returns {StringArray} list of loop signatures -*/ -function signatures( dtypes ) { - var casts; - var out; - var ch1; - var ch2; - var t1; - var t2; - var N; - var s; - var i; - var j; - - N = dtypes.length; - - // Generate the list of signatures: - out = []; - for ( i = 0; i < N; i++ ) { - t1 = dtypes[ i ]; - - // Resolve single-letter dtype abbreviation: - ch1 = dtypeChar( t1 ); - - // Generate the input/output array signature: - s = ch1+'_x'; // e.g., d_x - out.push( s ); - - // Resolve the list of safe casts for the input dtype: - casts = safeCasts( t1 ); - - // Remove the excluded dtypes: - casts = filter( casts, EXCLUDE_DTYPES ); - - // Generate signatures for allowed casts: - for ( j = 0; j < casts.length; j++ ) { - t2 = casts[ j ]; - if ( t2 === t1 ) { - continue; - } - ch2 = dtypeChar( t2 ); - out.push( s+'_as_'+ch2+'_x' ); // e.g., `b_x_as_i_x` - } - } - // Append any special loops: - for ( i = 0; i < SPECIAL_LOOPS.length; i++ ) { - out.push( SPECIAL_LOOPS[ i ] ); - } - return out.sort(); -} - -/** -* Creates a header file for a provided loop signature. -* -* @private -* @param {string} signature - loop signature -* @throws {Error} unexpected error -*/ -function createHeaderFile( signature ) { - var fpath; - var file; - var err; - - file = replace( TMPL_HEADER, '{{YEAR}}', CURRENT_YEAR ); - file = replace( file, '{{COPYRIGHT}}', COPYRIGHT ); - file = replace( file, '{{INCLUDE_GUARD}}', uppercase( signature ) ); - file = replace( file, '{{SIGNATURE}}', signature ); - - fpath = path.join( INCLUDE_DIR, 'predicate', signature+'.h' ); - - debug( 'Creating header file: %s', fpath ); - err = writeFile( fpath, file, FOPTS ); - if ( err ) { - throw err; - } -} - -/** -* Creates header files for a list of loop signatures. -* -* @private -* @param {StringArray} signatures - list of loop signatures -*/ -function createHeaderFiles( signatures ) { - var i; - for ( i = 0; i < signatures.length; i++ ) { - createHeaderFile( signatures[ i ] ); - } -} - -/** -* Creates a source file for a provided loop signature. -* -* @private -* @param {string} signature - loop signature -* @throws {Error} unexpected error -*/ -function createSourceFile( signature ) { - var match1; - var match2; - var macro; - var fpath; - var file; - var args; - var err; - var inc; - var tmp; - var ch1; - var ct1; - var nb1; - var t1; - - file = replace( TMPL_SOURCE, '{{YEAR}}', CURRENT_YEAR ); - file = replace( file, '{{COPYRIGHT}}', COPYRIGHT ); - file = replace( file, '{{SIGNATURE}}', signature ); - - // Ensure the appropriate header files are included in source files: - inc = []; - if ( /c/.test( signature ) ) { - inc.push( '#include "stdlib/complex/float32/ctor.h"' ); - } - if ( /z/.test( signature ) ) { - inc.push( '#include "stdlib/complex/float64/ctor.h"' ); - } - if ( inc.length ) { - file = replace( file, '{{INCLUDES}}', '\n'+inc.join( '\n' ) ); - } else { - file = replace( file, '{{INCLUDES}}', '' ); - } - // Ensure the appropriate header files are included in source documentation examples: - inc = []; - tmp = signature.substring( 3 ); // explicit callback signature; e.g., _as_d_x, _as_z_x - if ( tmp === '' ) { - tmp = signature.substring( 0, 1 ); // implicit callback signature; e.g., c, z, d, f, etc - } - if ( /c/.test( tmp ) ) { - inc.push( '#include "stdlib/complex/float32/ctor.h"' ); - } - if ( /z/.test( tmp ) ) { - inc.push( '#include "stdlib/complex/float64/ctor.h"' ); - } - if ( inc.length ) { - file = replace( file, '{{EXAMPLE_INCLUDES}}', '\n* '+inc.join( '\n* ' ) ); - } else { - file = replace( file, '{{EXAMPLE_INCLUDES}}', '' ); - } - // Resolve the array data types: - match1 = signature.match( RE_SIGNATURE ); - ch1 = match1[ 1 ]; - t1 = char2dtype( ch1 ); - - // Define array data types: - file = replace( file, '{{INPUT_NDARRAY_1_DTYPE_UPPER}}', uppercase( t1 ) ); - file = replace( file, '{{INPUT_NDARRAY_1_DTYPE_LOWER}}', t1 ); - - // Define the input array C data type: - file = replace( file, '{{INPUT_NDARRAY_1_CTYPE}}', dtype2c( t1 ) ); - - // Define the number of bytes per element for the respective arrays: - nb1 = bytesPerElement( t1 ); - file = replace( file, '{{INPUT_NDARRAY_1_BYTES_PER_ELEMENT}}', nb1.toString() ); - - // Define the array shapes: - file = defineShapes( file, SHAPES ); - - // Define underlying byte arrays: - file = defineByteArrays( file, SHAPES, nb1 ); - - // Define array strides: - file = defineStrides( file, SHAPES, nb1, ORDER ); - - // Resolve the callback parameter data types: - match2 = signature.match( RE_CALLBACK ); - if ( match2 ) { - ch1 = match2[ 1 ]; - ct1 = dtype2c( char2dtype( ch1 ) ); - } else { - ct1 = dtype2c( t1 ); - } - file = replace( file, '{{CALLBACK_PARAM_1_DTYPE}}', ct1 ); - file = replace( file, '{{CALLBACK_BODY}}', callbackBody( ch1 ) ); - - // Resolve the 0D callback expression: - if ( match2 ) { // (match1[1])_x_as_(ch1)_x - if ( ch1 === 'z' ) { // e.g., c_x_as_z_x - tmp = format( 'f( stdlib_complex128_from_%s( v ) )', t1 ); - } else if ( ch1 === 'c' ) { // e.g., f_x_as_c_x - tmp = format( 'f( stdlib_complex64_from_%s( v ) )', t1 ); - } else { // e.g., d_x_as_f_x, f_x_as_d_x - tmp = format( 'f( (%s)v )', ct1 ); - } - } else { // e.g., c, z, f, d, b, etc - tmp = 'f( v )'; - } - file = replace( file, '{{CALLBACK_EXPRESSION_0D}}', tmp ); - - // Resolve the loop macro: - if ( match2 ) { // (match1[1])_x_as_(ch1)_x - args = [ dtype2c( t1 ) ]; - if ( isComplexChar( ch1 ) ) { - macro = MACROS.acast; // e.g., `c_x_as_z_x` - if ( ch1 === 'z' ) { - args.push( 'stdlib_complex128_from_'+t1 ); // e.g., `c_x_as_z_x` - } else { // ch1 === 'c' - args.push( 'stdlib_complex64_from_'+t1 ); // e.g., `f_x_as_c_x` - } - } else { // e.g., `f_x_as_d_x` - macro = MACROS.cast; - args.push( ct1 ); - } - } else { - macro = MACROS.default; - args = [ ct1 ]; - } - file = replace( file, '{{PREDICATE_LOOP_MACRO}}', macro ); - file = replace( file, '{{PREDICATE_LOOP_MACRO_ARGUMENTS}}', args.join( ', ' ) ); - - // Create the source file: - fpath = path.join( SRC_DIR, signature+'.c' ); - debug( 'Creating source file: %s', fpath ); - err = writeFile( fpath, file, FOPTS ); - if ( err ) { - throw err; - } -} - -/** -* Creates source files for a list of loop signatures. -* -* @private -* @param {StringArray} signatures - list of loop signatures -*/ -function createSourceFiles( signatures ) { - var i; - for ( i = 0; i < signatures.length; i++ ) { - createSourceFile( signatures[ i ] ); - } -} - -/** -* Generates README documentation for a loop interface. -* -* @private -* @param {string} signature - loop signature -* @returns {string} documentation -*/ -function createDoc( signature ) { - var match; - var inc; - var doc; - var ch1; - var ct1; - var tmp; - var nb1; - var t1; - - doc = replace( TMPL_README, '{{SIGNATURE}}', signature ); - - // Ensure appropriate header files are included in documentation examples: - inc = []; - tmp = signature.substring( 3 ); // explicit callback signature; e.g., _as_d_x, _as_z_x - if ( tmp === '' ) { - tmp = signature.substring( 0, 1 ); // implicit callback signature; e.g., c, z, d, f, etc - } - if ( /c/.test( tmp ) ) { - inc.push( '#include "stdlib/complex/float32/ctor.h"' ); - } - if ( /z/.test( tmp ) ) { - inc.push( '#include "stdlib/complex/float64/ctor.h"' ); - } - if ( inc.length ) { - doc = replace( doc, '{{EXAMPLE_INCLUDES}}', '\n'+inc.join( '\n' ) ); - } else { - doc = replace( doc, '{{EXAMPLE_INCLUDES}}', '' ); - } - // Resolve the array data types: - match = signature.match( RE_SIGNATURE ); - ch1 = match[ 1 ]; - t1 = char2dtype( ch1 ); - - // Define array data types: - doc = replace( doc, '{{INPUT_NDARRAY_1_DTYPE_UPPER}}', uppercase( t1 ) ); - - // Define the number of bytes per element for the respective arrays: - nb1 = bytesPerElement( t1 ); - doc = replace( doc, '{{INPUT_NDARRAY_1_BYTES_PER_ELEMENT}}', nb1.toString() ); - - // Define the array shapes: - doc = defineShapes( doc, SHAPES ); - - // Define underlying byte arrays: - doc = defineByteArrays( doc, SHAPES, nb1 ); - - // Define array strides: - doc = defineStrides( doc, SHAPES, nb1, ORDER ); - - // Resolve the callback parameter data types: - match = signature.match( RE_CALLBACK ); - if ( match ) { - ch1 = match[ 1 ]; - ct1 = dtype2c( char2dtype( ch1 ) ); - } else { - ct1 = dtype2c( t1 ); - } - doc = replace( doc, '{{CALLBACK_PARAM_1_DTYPE}}', ct1 ); - doc = replace( doc, '{{CALLBACK_BODY}}', callbackBody( ch1 ) ); - - return doc; -} - -/** -* Update the package README. -* -* @private -* @param {StringArray} signatures - list of (sorted) loop signatures -* @throws {Error} unexpected error -*/ -function updateREADME( signatures ) { - var parts; - var file; - var docs; - var out; - var err; - var i; - - file = readFile( README, FOPTS ); - if ( file instanceof Error ) { - throw file; - } - docs = []; - for ( i = 0; i < signatures.length; i++ ) { - docs.push( createDoc( signatures[ i ] ) ); - } - out = []; - parts = file.split( '\n' ); - out.push( parts[ 0 ] ); - out.push( '' ); - out.push( '' ); - out.push( docs.join( '\n' ) ); - - parts = parts[ 1 ].split( '\n' ); - out.push( '' ); - out.push( parts[ 1 ] ); - - err = writeFile( README, out.join( '\n' ), FOPTS ); - if ( err ) { - throw err; - } -} - -/** -* Updates the main header file. -* -* @private -* @param {StringArray} signatures - list of (sorted) loop signatures -* @throws {Error} unexpected error -*/ -function updateMainHeader( signatures ) { - var file; - var list; - var err; - var sig; - var ch; - var i; - - file = readFile( INCLUDE_MAIN, FOPTS ); - if ( file instanceof Error ) { - throw file; - } - list = []; - ch = signatures[ 0 ].charAt( 0 ); - for ( i = 0; i < signatures.length; i++ ) { - sig = signatures[ i ]; - if ( sig.charAt( 0 ) !== ch ) { - ch = sig.charAt( 0 ); - list.push( '' ); - } - list.push( '#include "every/predicate/'+sig+'.h"' ); - } - file = [ - substringBefore( file, '\n// BEGIN PREDICATE LOOPS' ), - '// BEGIN PREDICATE LOOPS', - list.join( '\n' ), - '// END PREDICATE LOOPS', - substringAfter( file, '// END PREDICATE LOOPS\n' ) - ].join( '\n' ); - - err = writeFile( INCLUDE_MAIN, file, FOPTS ); - if ( err ) { - throw err; - } -} - -/** -* Updates the package manifest. -* -* @private -* @param {StringArray} signatures - list of (sorted) loop signatures -* @throws {Error} unexpected error -*/ -function updateManifest( signatures ) { - var file; - var list; - var tmp; - var err; - var l; - var i; - var j; - - file = readJSON( MANIFEST, FOPTS ); - if ( file instanceof Error ) { - throw file; - } - list = []; - for ( i = 0; i < signatures.length; i++ ) { - list.push( './src/predicate/'+signatures[ i ]+'.c' ); - } - for ( j = 0; j < file.confs.length; j++ ) { - l = list.slice(); - - // Copy over non-signature source files... - tmp = file.confs[ j ].src; - for ( i = 0; i < tmp.length; i++ ) { - if ( RE_MANIFEST_LOOP_FILE.test( tmp[ i ] ) === false ) { - l.push( tmp[ i ] ); - } - } - l.sort(); - - // Replace the list of source files: - file.confs[ j ].src = l; - } - err = writeFile( MANIFEST, JSON.stringify( file, null, 2 )+'\n', FOPTS ); - if ( err ) { - throw err; - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var sigs; - var dir; - - debug( 'Data types: %s', DTYPES.join( ', ' ) ); - - // Generate the list of loop signatures: - sigs = signatures( DTYPES ); - debug( 'Signatures: %s', '\n'+sigs.join( '\n' ) ); - - // Remove loop files from output directories: - dir = path.join( INCLUDE_DIR, 'predicate' ); - debug( 'Clearing include directory: %s', dir ); - removeFilesByRegExp( dir, RE_LOOP_FILE ); - - debug( 'Clearing source directory: %s', SRC_DIR ); - removeFilesByRegExp( SRC_DIR, RE_LOOP_FILE ); - - // Create header files for the list of loop signatures: - debug( 'Creating header files...' ); - createHeaderFiles( sigs ); - - // Create source files for the list of loop signatures: - debug( 'Creating source files...' ); - createSourceFiles( sigs ); - - // Update the main header file to include the loop header files: - debug( 'Updating main header file: %s', INCLUDE_MAIN ); - updateMainHeader( sigs ); - - // Update the package manifest to include the loop source files: - debug( 'Updating manifest file: %s', MANIFEST ); - updateManifest( sigs ); - - // Update the package README to include the loop interfaces: - debug( 'Updating README file: %s', README ); - updateREADME( sigs ); - - debug( 'Finished.' ); -} - -main(); diff --git a/scripts/templates/inline/docs.txt b/scripts/templates/inline/docs.txt deleted file mode 100644 index 22a75fd..0000000 --- a/scripts/templates/inline/docs.txt +++ /dev/null @@ -1,86 +0,0 @@ -#### stdlib_ndarray_every_{{SIGNATURE}}( \*arrays\[], \*data ) - -Tests whether every element in an input ndarray is truthy. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_2D}} }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { {{NDARRAY_SHAPE_2D}} }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_2D}} }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Test elements: -int8_t status = stdlib_ndarray_every_{{SIGNATURE}}( arrays, NULL ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to a zero-dimensional output ndarray. -- **data**: `[in] void*` function data. This argument is unused and should be a `NULL` pointer. - -```c -int8_t stdlib_ndarray_every_{{SIGNATURE}}( struct ndarray *arrays[], void *data ); -``` diff --git a/scripts/templates/inline/header.txt b/scripts/templates/inline/header.txt deleted file mode 100644 index fde5d89..0000000 --- a/scripts/templates/inline/header.txt +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) {{YEAR}} {{COPYRIGHT}}. -* -* 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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_INLINE_{{INCLUDE_GUARD}}_H -#define STDLIB_NDARRAY_BASE_EVERY_INLINE_{{INCLUDE_GUARD}}_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_0d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_1d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_2d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_2d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_3d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_3d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_4d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_4d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_5d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_5d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_6d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_6d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_7d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_7d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_8d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_8d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_9d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_9d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_10d( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_10d_blocked( struct ndarray *arrays[], void *data ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_nd( struct ndarray *arrays[], void *data ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_INLINE_{{INCLUDE_GUARD}}_H diff --git a/scripts/templates/inline/source.txt b/scripts/templates/inline/source.txt deleted file mode 100644 index 9e8f0b1..0000000 --- a/scripts/templates/inline/source.txt +++ /dev/null @@ -1,2061 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) {{YEAR}} {{COPYRIGHT}}. -* -* 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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h"{{INCLUDES}} -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_0D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_0d( struct ndarray *arrays[], void *data ) { - {{INPUT_NDARRAY_1_CTYPE}} v; - int8_t status = stdlib_ndarray_iget_{{INPUT_NDARRAY_1_DTYPE_LOWER}}( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, {{INLINE_EXPRESSION_0D}} ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_1D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_1D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_BYTES_PER_ELEMENT}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_2D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_2D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_2D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_2D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_2D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_2D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_3D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_3D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_3D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_3D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_3D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_3D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_4D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_4D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_4D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_4D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_4D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_4D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_5D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_5D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_5D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_5D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_5D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_5D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_6D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_6D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_6D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_6D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_6D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_6D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_7D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_7D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_7D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_7D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_7D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_7D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_8D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_8D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_8D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_8D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_8D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_8D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_9D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_9D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_9D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_9D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_9D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_9D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_10D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_10D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_10D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_10D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_10D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_10D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_3D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_3D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_3D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( {{INLINE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_{{SIGNATURE}}_0d, - stdlib_ndarray_every_{{SIGNATURE}}_1d, - stdlib_ndarray_every_{{SIGNATURE}}_2d, - stdlib_ndarray_every_{{SIGNATURE}}_3d, - stdlib_ndarray_every_{{SIGNATURE}}_4d, - stdlib_ndarray_every_{{SIGNATURE}}_5d, - stdlib_ndarray_every_{{SIGNATURE}}_6d, - stdlib_ndarray_every_{{SIGNATURE}}_7d, - stdlib_ndarray_every_{{SIGNATURE}}_8d, - stdlib_ndarray_every_{{SIGNATURE}}_9d, - stdlib_ndarray_every_{{SIGNATURE}}_10d, - stdlib_ndarray_every_{{SIGNATURE}}_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_{{SIGNATURE}}_2d_blocked, - stdlib_ndarray_every_{{SIGNATURE}}_3d_blocked, - stdlib_ndarray_every_{{SIGNATURE}}_4d_blocked, - stdlib_ndarray_every_{{SIGNATURE}}_5d_blocked, - stdlib_ndarray_every_{{SIGNATURE}}_6d_blocked, - stdlib_ndarray_every_{{SIGNATURE}}_7d_blocked, - stdlib_ndarray_every_{{SIGNATURE}}_8d_blocked, - stdlib_ndarray_every_{{SIGNATURE}}_9d_blocked, - stdlib_ndarray_every_{{SIGNATURE}}_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_2D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_2D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_2D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_{{SIGNATURE}}( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_{{SIGNATURE}}( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/scripts/templates/predicate/docs.txt b/scripts/templates/predicate/docs.txt deleted file mode 100644 index 40a3f4e..0000000 --- a/scripts/templates/predicate/docs.txt +++ /dev/null @@ -1,91 +0,0 @@ -#### stdlib_ndarray_every_by_{{SIGNATURE}}( \*arrays\[], \*fcn ) - -Tests whether every element in an input ndarray is truthy according to a predicate function. - -```c -#include "stdlib/ndarray/dtypes.h" -#include "stdlib/ndarray/index_modes.h" -#include "stdlib/ndarray/orders.h" -#include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -#include -#include -#include -#include - -// Define the ndarray data types: -enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; - -// Create underlying byte arrays: -uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_2D}} }; -uint8_t ybuf[] = { 0 }; - -// Define the number of dimensions: -int64_t ndims = 2; - -// Define the array shapes: -int64_t shx[] = { {{NDARRAY_SHAPE_2D}} }; -int64_t *shy = NULL; - -// Define the strides: -int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_2D}} }; -int64_t sy[] = { 0 }; - -// Define the index offsets: -int64_t ox = 0; -int64_t oy = 0; - -// Define the array order: -enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; - -// Specify the index mode: -enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; - -// Specify the subscript index modes: -int8_t submodes[] = { imode }; -int64_t nsubmodes = 1; - -// Create an input ndarray: -struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -if ( x == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an output ndarray: -struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -if ( y == NULL ) { - fprintf( stderr, "Error allocating memory.\n" ); - exit( EXIT_FAILURE ); -} - -// Create an array containing the ndarrays: -struct ndarray *arrays[] = { x, y }; - -// Define a callback: -static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { - {{CALLBACK_BODY}} -} - -// Test elements: -int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}( arrays, (void *)fcn ); -if ( status != 0 ) { - fprintf( stderr, "Error during computation.\n" ); - exit( EXIT_FAILURE ); -} - -// ... - -// Free allocated memory: -stdlib_ndarray_free( x ); -stdlib_ndarray_free( y ); -``` - -The function accepts the following arguments: - -- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray. -- **fcn**: `[in] void*` a `bool (*f)({{CALLBACK_PARAM_1_DTYPE}})` predicate function to apply provided as a `void` pointer. - -```c -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}( struct ndarray *arrays[], void *fcn ); -``` diff --git a/scripts/templates/predicate/header.txt b/scripts/templates/predicate/header.txt deleted file mode 100644 index 78a08ce..0000000 --- a/scripts/templates/predicate/header.txt +++ /dev/null @@ -1,150 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) {{YEAR}} {{COPYRIGHT}}. -* -* 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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#ifndef STDLIB_NDARRAY_BASE_EVERY_PREDICATE_{{INCLUDE_GUARD}}_H -#define STDLIB_NDARRAY_BASE_EVERY_PREDICATE_{{INCLUDE_GUARD}}_H - -#include "stdlib/ndarray/ctor.h" -#include - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_0d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_1d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_2d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_2d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_3d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_3d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_4d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_4d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_5d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_5d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_6d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_6d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_7d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_7d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_8d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_8d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_9d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_9d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_10d( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_10d_blocked( struct ndarray *arrays[], void *fcn ); - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns the result to a zero-dimensional output ndarray. -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_nd( struct ndarray *arrays[], void *fcn ); - -#ifdef __cplusplus -} -#endif - -#endif // !STDLIB_NDARRAY_BASE_EVERY_PREDICATE_{{INCLUDE_GUARD}}_H diff --git a/scripts/templates/predicate/source.txt b/scripts/templates/predicate/source.txt deleted file mode 100644 index 6403e92..0000000 --- a/scripts/templates/predicate/source.txt +++ /dev/null @@ -1,2213 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) {{YEAR}} {{COPYRIGHT}}. -* -* 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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h"{{INCLUDES}} -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_0D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_0d( struct ndarray *arrays[], void *fcn ) { - {{INPUT_NDARRAY_1_CTYPE}} v; - int8_t status = stdlib_ndarray_iget_{{INPUT_NDARRAY_1_DTYPE_LOWER}}( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, {{CALLBACK_EXPRESSION_0D}} ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_1D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_1D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_BYTES_PER_ELEMENT}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_2D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_2D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_2D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_2D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_2D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_2D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_3D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_3D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_3D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_3D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_3D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_3D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_4D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_4D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_4D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_4D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_4D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_4D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_5D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_5D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_5D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_5D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_5D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_5D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_6D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_6D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_6D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_6D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_6D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_6D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_7D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_7D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_7D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_7D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_7D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_7D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_8D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_8D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_8D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_8D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_8D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_8D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_9D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_9D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_9D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_9D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_9D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_9D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_10D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_10D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_10D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_10D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_10D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_10D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_3D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_3D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_3D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const {{CALLBACK_PARAM_1_DTYPE}} x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_{{PREDICATE_LOOP_MACRO}}( {{PREDICATE_LOOP_MACRO_ARGUMENTS}} ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_{{SIGNATURE}}_0d, - stdlib_ndarray_every_by_{{SIGNATURE}}_1d, - stdlib_ndarray_every_by_{{SIGNATURE}}_2d, - stdlib_ndarray_every_by_{{SIGNATURE}}_3d, - stdlib_ndarray_every_by_{{SIGNATURE}}_4d, - stdlib_ndarray_every_by_{{SIGNATURE}}_5d, - stdlib_ndarray_every_by_{{SIGNATURE}}_6d, - stdlib_ndarray_every_by_{{SIGNATURE}}_7d, - stdlib_ndarray_every_by_{{SIGNATURE}}_8d, - stdlib_ndarray_every_by_{{SIGNATURE}}_9d, - stdlib_ndarray_every_by_{{SIGNATURE}}_10d, - stdlib_ndarray_every_by_{{SIGNATURE}}_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_{{SIGNATURE}}_2d_blocked, - stdlib_ndarray_every_by_{{SIGNATURE}}_3d_blocked, - stdlib_ndarray_every_by_{{SIGNATURE}}_4d_blocked, - stdlib_ndarray_every_by_{{SIGNATURE}}_5d_blocked, - stdlib_ndarray_every_by_{{SIGNATURE}}_6d_blocked, - stdlib_ndarray_every_by_{{SIGNATURE}}_7d_blocked, - stdlib_ndarray_every_by_{{SIGNATURE}}_8d_blocked, - stdlib_ndarray_every_by_{{SIGNATURE}}_9d_blocked, - stdlib_ndarray_every_by_{{SIGNATURE}}_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/{{SIGNATURE}}.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h"{{EXAMPLE_INCLUDES}} -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_{{INPUT_NDARRAY_1_DTYPE_UPPER}}; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { {{INPUT_NDARRAY_1_BYTES_2D}} }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { {{NDARRAY_SHAPE_2D}} }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { {{INPUT_NDARRAY_1_STRIDES_2D}} }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const {{CALLBACK_PARAM_1_DTYPE}} x ) { -* {{CALLBACK_BODY}} -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_{{SIGNATURE}}( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_{{SIGNATURE}}( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/README.md b/src/README.md deleted file mode 100644 index 6f4ca97..0000000 --- a/src/README.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# src - -> ndarray function source code. - -## Notes - -- Each file contains a set of related ndarray functions. The file name matches the ndarray function name suffix for output ndarray dtype. -- The implemented functions which perform conversions are **not** exhaustive and that is intentional. Namely, functions which would perform "unsafe" callback return value conversions are not included (e.g., converting `double` to `int32`). If users want to perform "unsafe" conversions, that should be a conscious decision. All the machinery (e.g., macros, typedefs, etc) is available for implementing ndarray functions which perform "unsafe" conversions, but we should not make this overly easy or be proactive in promoting "unsafe" conversion use. diff --git a/src/dispatch.c b/src/dispatch.c deleted file mode 100644 index 82a3bcc..0000000 --- a/src/dispatch.c +++ /dev/null @@ -1,328 +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. -*/ - -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/iteration_order.h" -#include "stdlib/ndarray/base/bytes_per_element.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element is truthy in an n-dimensional input ndarray having `ndims-1` singleton dimensions and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If able to successfully perform operation, the function returns `0`; otherwise, the function returns an error code. -* -* @param f ndarray function -* @param x1 input ndarray -* @param x2 output ndarray -* @param i index of the non-singleton dimension -* @param data function data (e.g., a callback) -* @return status code -*/ -static int8_t stdlib_ndarray_every_1d_squeeze( const ndarrayEveryFcn f, struct ndarray *x1, struct ndarray *x2, const int64_t i, void *data ) { - int64_t sh[] = { stdlib_ndarray_shape( x1 )[ i ] }; - - // Shallow copy and reshape the array... - int64_t sx1[] = { stdlib_ndarray_strides( x1 )[ i ] }; - struct ndarray *x1c = stdlib_ndarray_allocate( - stdlib_ndarray_dtype( x1 ), - stdlib_ndarray_data( x1 ), - 1, - sh, - sx1, - stdlib_ndarray_offset( x1 ), - stdlib_ndarray_order( x1 ), - stdlib_ndarray_index_mode( x1 ), - stdlib_ndarray_nsubmodes( x1 ), - stdlib_ndarray_submodes( x1 ) - ); - if ( x1c == NULL ) { - return -1; - } - // Perform computation: - struct ndarray *arrays[] = { x1c, x2 }; - int8_t status = f( arrays, data ); - - // Free allocated memory: - stdlib_ndarray_free( x1c ); - - return status; -} - -/** -* Tests whether every element is truthy in a flattened n-dimensional input ndarray and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If able to successfully perform operation, the function returns `0`; otherwise, the function returns an error code. -* -* @param f ndarray function -* @param N number of elements -* @param x1 input ndarray -* @param s1 input ndarray stride length -* @param x2 output ndarray -* @param data function data (e.g., a callback) -* @return status code -*/ -static int8_t stdlib_ndarray_every_1d_flatten( const ndarrayEveryFcn f, const int64_t N, struct ndarray *x1, const int64_t s1, struct ndarray *x2, void *data ) { - // Define the (flattened) strided array shape: - int64_t sh[] = { N }; - - // Shallow copy and reshape the array... - int64_t sx1[] = { s1 }; - struct ndarray *x1c = stdlib_ndarray_allocate( - stdlib_ndarray_dtype( x1 ), - stdlib_ndarray_data( x1 ), - 1, - sh, - sx1, - stdlib_ndarray_offset( x1 ), - stdlib_ndarray_order( x1 ), - stdlib_ndarray_index_mode( x1 ), - stdlib_ndarray_nsubmodes( x1 ), - stdlib_ndarray_submodes( x1 ) - ); - if ( x1c == NULL ) { - return -1; - } - // Perform computation: - struct ndarray *arrays[] = { x1c, x2 }; - int8_t status = f( arrays, data ); - - // Free allocated memory: - stdlib_ndarray_free( x1c ); - - return status; -} - -/** -* Dispatches to an ndarray function according to the dimensionality of provided ndarray arguments. -* -* ## Notes -* -* - If able to successfully dispatch, the function returns `0`; otherwise, the function returns an error code. -* -* @param obj object comprised of dispatch tables containing ndarray functions -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data (e.g., a callback) -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/dispatch.h" -* #include "stdlib/ndarray/base/every/dispatch_object.h" -* #include "stdlib/ndarray/base/every/typedefs.h" -* #include "stdlib/ndarray/base/every/b.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* -* // Define a list of ndarray functions: -* ndarrayEveryFcn functions[] = { -* stdlib_ndarray_every_b_x_0d, -* stdlib_ndarray_every_b_x_1d, -* stdlib_ndarray_every_b_x_2d, -* stdlib_ndarray_every_b_x_3d, -* stdlib_ndarray_every_b_x_4d, -* stdlib_ndarray_every_b_x_5d, -* stdlib_ndarray_every_b_x_6d, -* stdlib_ndarray_every_b_x_7d, -* stdlib_ndarray_every_b_x_8d, -* stdlib_ndarray_every_b_x_9d, -* stdlib_ndarray_every_b_x_10d -* stdlib_ndarray_every_b_x_nd -* }; -* -* // Define a list of ndarray functions using loop blocking... -* ndarrayEveryFcn blocked_functions[] = { -* stdlib_ndarray_every_b_x_2d_blocked, -* stdlib_ndarray_every_b_x_3d_blocked, -* stdlib_ndarray_every_b_x_4d_blocked, -* stdlib_ndarray_every_b_x_5d_blocked, -* stdlib_ndarray_every_b_x_6d_blocked, -* stdlib_ndarray_every_b_x_7d_blocked, -* stdlib_ndarray_every_b_x_8d_blocked, -* stdlib_ndarray_every_b_x_9d_blocked, -* stdlib_ndarray_every_b_x_10d_blocked -* }; -* -* // Create a function dispatch object: -* struct ndarrayNullaryDispatchObject obj = { -* // Array containing ndarray functions: -* functions, -* -* // Number of ndarray functions: -* 12, -* -* // Array containing ndarray functions using loop blocking: -* blocked_functions, -* -* // Number of ndarray functions using loop blocking: -* 9 -* } -* -* // Define a function which performs dispatch: -* int8_t stdlib_ndarray_every_b_x( struct ndarray *arrays[], void *data ) { -* return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -* } -* -* // ... -* -* // Create ndarrays: -* struct ndarray *x = stdlib_ndarray_allocate( ... ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* struct ndarray *y = stdlib_ndarray_allocate( ... ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Perform computation: -* struct ndarray *arrays[] = { x, y }; -* int8_t status = stdlib_ndarray_every_b_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -*/ -int8_t stdlib_ndarray_every_dispatch( const struct ndarrayEveryDispatchObject *obj, struct ndarray *arrays[], void *data ) { - const int64_t *sh1; - struct ndarray *x1; - struct ndarray *x2; - int8_t status; - int64_t ndims; - int64_t mab1; - int64_t mib1; - int64_t *s1; - int64_t len; - int64_t bp1; - int8_t io1; - int64_t ns; - int64_t s; - int64_t d; - int64_t i; - - // Unpack the arrays: - x1 = arrays[ 0 ]; - x2 = arrays[ 1 ]; - - // Determine whether we can avoid iteration altogether... - ndims = stdlib_ndarray_ndims( x1 ); - if ( ndims == 0 ) { - obj->functions[ 0 ]( arrays, data ); - return 0; - } - sh1 = stdlib_ndarray_shape( x1 ); - - // Compute the number of elements and the number of singleton dimensions... - len = 1; // number of elements - ns = 0; // number of singleton dimensions - for ( i = 0; i < ndims; i++ ) { - d = sh1[ i ]; - - // Note that, if one of the dimensions is `0`, the length will be `0`... - len *= d; - - // Check whether the current dimension is a singleton dimension... - if ( d == 1 ) { - ns += 1; - } - } - // Check whether we were provided an empty ndarray... - if ( len == 0 ) { - return 0; - } - // Determine whether the input ndarray is one-dimensional and thus readily translates to a one-dimensional strided array... - if ( ndims == 1 ) { - obj->functions[ 1 ]( arrays, data ); - return 0; - } - // Determine whether the input ndarray has only **one** non-singleton dimension (e.g., ndims=4, shape=[10,1,1,1]) so that we can treat the ndarray as being equivalent to a one-dimensional strided array... - if ( ns == ndims-1 ) { - // Get the index of the non-singleton dimension... - for ( i = 0; i < ndims; i++ ) { - if ( sh1[ i ] != 1 ) { - break; - } - } - // Remove the singleton dimensions and perform computation... - status = stdlib_ndarray_every_1d_squeeze( obj->functions[ 1 ], x1, x2, i, data ); - if ( status == 0 ) { - return 0; - } - // If we failed, this is probably due to failed memory allocation, so fall through and try again... - } - s1 = stdlib_ndarray_strides( x1 ); - io1 = stdlib_ndarray_iteration_order( ndims, s1 ); // +/-1 - - // Determine whether we can avoid blocked iteration... - if ( io1 != 0 ) { - // Determine the minimum and maximum linear byte indices which are accessible by the array view: - mib1 = stdlib_ndarray_offset( x1 ); // byte offset - mab1 = mib1; - for ( i = 0; i < ndims; i++ ) { - s = s1[ i ]; // units: bytes - if ( s > 0 ) { - mab1 += s * ( sh1[i]-1 ); - } else if ( s < 0 ) { - mib1 += s * ( sh1[i]-1 ); // decrements - } - } - bp1 = stdlib_ndarray_bytes_per_element( stdlib_ndarray_dtype( x1 ) ); - - // Determine whether we can ignore shape (and strides) and treat the input ndarray as a linear one-dimensional strided array... - if ( ( len*bp1 ) == ( mab1-mib1+bp1 ) ) { - // Note: the above is equivalent to @stdlib/ndarray/base/assert/is-contiguous, but in-lined so we can retain computed values... - status = stdlib_ndarray_every_1d_flatten( obj->functions[ 1 ], len, x1, io1*bp1, x2, data ); - if ( status == 0 ) { - return 0; - } - // If we failed, this is probably due to failed memory allocation, so fall through and try again... - } - // The input ndarray is non-contiguous, so we cannot directly use one-dimensional array functionality... - - // Determine whether we can use simple nested loops... - if ( ndims < (obj->nfunctions) ) { - // So long as iteration for the array always moves in the same direction (i.e., no mixed sign strides), we can leverage cache-optimal (i.e., normal) nested loops without resorting to blocked iteration... - obj->functions[ ndims ]( arrays, data ); - return 0; - } - // Fall-through to blocked iteration... - } - // At this point, we're either dealing with either a non-contiguous n-dimensional array or a high dimensional n-dimensional array, so our only hope is that we can still perform blocked iteration... - - // Determine whether we can perform blocked iteration... - if ( ndims <= (obj->nblockedfunctions)+1 ) { - obj->blocked_functions[ ndims-2 ]( arrays, data ); - return 0; - } - // Fall-through to linear view iteration without regard for how data is stored in memory (i.e., take the slow path)... - obj->functions[ (obj->nfunctions)-1 ]( arrays, data ); - - return 0; -} diff --git a/src/inline/b_x.c b/src/inline/b_x.c deleted file mode 100644 index 8387607..0000000 --- a/src/inline/b_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/b_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_0d( struct ndarray *arrays[], void *data ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( v != 0 ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( uint8_t, ( in1 != 0 ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_b_x_0d, - stdlib_ndarray_every_b_x_1d, - stdlib_ndarray_every_b_x_2d, - stdlib_ndarray_every_b_x_3d, - stdlib_ndarray_every_b_x_4d, - stdlib_ndarray_every_b_x_5d, - stdlib_ndarray_every_b_x_6d, - stdlib_ndarray_every_b_x_7d, - stdlib_ndarray_every_b_x_8d, - stdlib_ndarray_every_b_x_9d, - stdlib_ndarray_every_b_x_10d, - stdlib_ndarray_every_b_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_b_x_2d_blocked, - stdlib_ndarray_every_b_x_3d_blocked, - stdlib_ndarray_every_b_x_4d_blocked, - stdlib_ndarray_every_b_x_5d_blocked, - stdlib_ndarray_every_b_x_6d_blocked, - stdlib_ndarray_every_b_x_7d_blocked, - stdlib_ndarray_every_b_x_8d_blocked, - stdlib_ndarray_every_b_x_9d_blocked, - stdlib_ndarray_every_b_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_b_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_b_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/c_x.c b/src/inline/c_x.c deleted file mode 100644 index 9aafd20..0000000 --- a/src/inline/c_x.c +++ /dev/null @@ -1,2086 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/c_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float32/real.h" -#include "stdlib/complex/float32/imag.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_0d( struct ndarray *arrays[], void *data ) { - stdlib_complex64_t v; - int8_t status = stdlib_ndarray_iget_complex64( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( stdlib_complex64_real( v ) != 0.0f || stdlib_complex64_imag( v ) != 0.0f ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( stdlib_complex64_t, ( stdlib_complex64_real( in1 ) != 0.0f || stdlib_complex64_imag( in1 ) != 0.0f ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_c_x_0d, - stdlib_ndarray_every_c_x_1d, - stdlib_ndarray_every_c_x_2d, - stdlib_ndarray_every_c_x_3d, - stdlib_ndarray_every_c_x_4d, - stdlib_ndarray_every_c_x_5d, - stdlib_ndarray_every_c_x_6d, - stdlib_ndarray_every_c_x_7d, - stdlib_ndarray_every_c_x_8d, - stdlib_ndarray_every_c_x_9d, - stdlib_ndarray_every_c_x_10d, - stdlib_ndarray_every_c_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_c_x_2d_blocked, - stdlib_ndarray_every_c_x_3d_blocked, - stdlib_ndarray_every_c_x_4d_blocked, - stdlib_ndarray_every_c_x_5d_blocked, - stdlib_ndarray_every_c_x_6d_blocked, - stdlib_ndarray_every_c_x_7d_blocked, - stdlib_ndarray_every_c_x_8d_blocked, - stdlib_ndarray_every_c_x_9d_blocked, - stdlib_ndarray_every_c_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_c_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_c_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/d_x.c b/src/inline/d_x.c deleted file mode 100644 index 0b49e6d..0000000 --- a/src/inline/d_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_0d( struct ndarray *arrays[], void *data ) { - double v; - int8_t status = stdlib_ndarray_iget_float64( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( v != 0.0 ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( double, ( in1 != 0.0 ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_d_x_0d, - stdlib_ndarray_every_d_x_1d, - stdlib_ndarray_every_d_x_2d, - stdlib_ndarray_every_d_x_3d, - stdlib_ndarray_every_d_x_4d, - stdlib_ndarray_every_d_x_5d, - stdlib_ndarray_every_d_x_6d, - stdlib_ndarray_every_d_x_7d, - stdlib_ndarray_every_d_x_8d, - stdlib_ndarray_every_d_x_9d, - stdlib_ndarray_every_d_x_10d, - stdlib_ndarray_every_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_d_x_2d_blocked, - stdlib_ndarray_every_d_x_3d_blocked, - stdlib_ndarray_every_d_x_4d_blocked, - stdlib_ndarray_every_d_x_5d_blocked, - stdlib_ndarray_every_d_x_6d_blocked, - stdlib_ndarray_every_d_x_7d_blocked, - stdlib_ndarray_every_d_x_8d_blocked, - stdlib_ndarray_every_d_x_9d_blocked, - stdlib_ndarray_every_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_d_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_d_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/f_x.c b/src/inline/f_x.c deleted file mode 100644 index 07c1032..0000000 --- a/src/inline/f_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/f_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_0d( struct ndarray *arrays[], void *data ) { - float v; - int8_t status = stdlib_ndarray_iget_float32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( v != 0.0f ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( float, ( in1 != 0.0f ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_f_x_0d, - stdlib_ndarray_every_f_x_1d, - stdlib_ndarray_every_f_x_2d, - stdlib_ndarray_every_f_x_3d, - stdlib_ndarray_every_f_x_4d, - stdlib_ndarray_every_f_x_5d, - stdlib_ndarray_every_f_x_6d, - stdlib_ndarray_every_f_x_7d, - stdlib_ndarray_every_f_x_8d, - stdlib_ndarray_every_f_x_9d, - stdlib_ndarray_every_f_x_10d, - stdlib_ndarray_every_f_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_f_x_2d_blocked, - stdlib_ndarray_every_f_x_3d_blocked, - stdlib_ndarray_every_f_x_4d_blocked, - stdlib_ndarray_every_f_x_5d_blocked, - stdlib_ndarray_every_f_x_6d_blocked, - stdlib_ndarray_every_f_x_7d_blocked, - stdlib_ndarray_every_f_x_8d_blocked, - stdlib_ndarray_every_f_x_9d_blocked, - stdlib_ndarray_every_f_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_f_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_f_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/i_x.c b/src/inline/i_x.c deleted file mode 100644 index b088b8f..0000000 --- a/src/inline/i_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/i_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_0d( struct ndarray *arrays[], void *data ) { - int32_t v; - int8_t status = stdlib_ndarray_iget_int32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( v != 0 ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( int32_t, ( in1 != 0 ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_i_x_0d, - stdlib_ndarray_every_i_x_1d, - stdlib_ndarray_every_i_x_2d, - stdlib_ndarray_every_i_x_3d, - stdlib_ndarray_every_i_x_4d, - stdlib_ndarray_every_i_x_5d, - stdlib_ndarray_every_i_x_6d, - stdlib_ndarray_every_i_x_7d, - stdlib_ndarray_every_i_x_8d, - stdlib_ndarray_every_i_x_9d, - stdlib_ndarray_every_i_x_10d, - stdlib_ndarray_every_i_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_i_x_2d_blocked, - stdlib_ndarray_every_i_x_3d_blocked, - stdlib_ndarray_every_i_x_4d_blocked, - stdlib_ndarray_every_i_x_5d_blocked, - stdlib_ndarray_every_i_x_6d_blocked, - stdlib_ndarray_every_i_x_7d_blocked, - stdlib_ndarray_every_i_x_8d_blocked, - stdlib_ndarray_every_i_x_9d_blocked, - stdlib_ndarray_every_i_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_i_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_i_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/k_x.c b/src/inline/k_x.c deleted file mode 100644 index 80df443..0000000 --- a/src/inline/k_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/k_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_0d( struct ndarray *arrays[], void *data ) { - int16_t v; - int8_t status = stdlib_ndarray_iget_int16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( v != 0 ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( int16_t, ( in1 != 0 ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_k_x_0d, - stdlib_ndarray_every_k_x_1d, - stdlib_ndarray_every_k_x_2d, - stdlib_ndarray_every_k_x_3d, - stdlib_ndarray_every_k_x_4d, - stdlib_ndarray_every_k_x_5d, - stdlib_ndarray_every_k_x_6d, - stdlib_ndarray_every_k_x_7d, - stdlib_ndarray_every_k_x_8d, - stdlib_ndarray_every_k_x_9d, - stdlib_ndarray_every_k_x_10d, - stdlib_ndarray_every_k_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_k_x_2d_blocked, - stdlib_ndarray_every_k_x_3d_blocked, - stdlib_ndarray_every_k_x_4d_blocked, - stdlib_ndarray_every_k_x_5d_blocked, - stdlib_ndarray_every_k_x_6d_blocked, - stdlib_ndarray_every_k_x_7d_blocked, - stdlib_ndarray_every_k_x_8d_blocked, - stdlib_ndarray_every_k_x_9d_blocked, - stdlib_ndarray_every_k_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_k_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_k_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/s_x.c b/src/inline/s_x.c deleted file mode 100644 index 0c89d29..0000000 --- a/src/inline/s_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/s_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_0d( struct ndarray *arrays[], void *data ) { - int8_t v; - int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( v != 0 ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( int8_t, ( in1 != 0 ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_s_x_0d, - stdlib_ndarray_every_s_x_1d, - stdlib_ndarray_every_s_x_2d, - stdlib_ndarray_every_s_x_3d, - stdlib_ndarray_every_s_x_4d, - stdlib_ndarray_every_s_x_5d, - stdlib_ndarray_every_s_x_6d, - stdlib_ndarray_every_s_x_7d, - stdlib_ndarray_every_s_x_8d, - stdlib_ndarray_every_s_x_9d, - stdlib_ndarray_every_s_x_10d, - stdlib_ndarray_every_s_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_s_x_2d_blocked, - stdlib_ndarray_every_s_x_3d_blocked, - stdlib_ndarray_every_s_x_4d_blocked, - stdlib_ndarray_every_s_x_5d_blocked, - stdlib_ndarray_every_s_x_6d_blocked, - stdlib_ndarray_every_s_x_7d_blocked, - stdlib_ndarray_every_s_x_8d_blocked, - stdlib_ndarray_every_s_x_9d_blocked, - stdlib_ndarray_every_s_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_s_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_s_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/t_x.c b/src/inline/t_x.c deleted file mode 100644 index 3a988e7..0000000 --- a/src/inline/t_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/t_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_0d( struct ndarray *arrays[], void *data ) { - uint16_t v; - int8_t status = stdlib_ndarray_iget_uint16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( v != 0 ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( uint16_t, ( in1 != 0 ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_t_x_0d, - stdlib_ndarray_every_t_x_1d, - stdlib_ndarray_every_t_x_2d, - stdlib_ndarray_every_t_x_3d, - stdlib_ndarray_every_t_x_4d, - stdlib_ndarray_every_t_x_5d, - stdlib_ndarray_every_t_x_6d, - stdlib_ndarray_every_t_x_7d, - stdlib_ndarray_every_t_x_8d, - stdlib_ndarray_every_t_x_9d, - stdlib_ndarray_every_t_x_10d, - stdlib_ndarray_every_t_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_t_x_2d_blocked, - stdlib_ndarray_every_t_x_3d_blocked, - stdlib_ndarray_every_t_x_4d_blocked, - stdlib_ndarray_every_t_x_5d_blocked, - stdlib_ndarray_every_t_x_6d_blocked, - stdlib_ndarray_every_t_x_7d_blocked, - stdlib_ndarray_every_t_x_8d_blocked, - stdlib_ndarray_every_t_x_9d_blocked, - stdlib_ndarray_every_t_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_t_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_t_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/u_x.c b/src/inline/u_x.c deleted file mode 100644 index 745054d..0000000 --- a/src/inline/u_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/u_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_0d( struct ndarray *arrays[], void *data ) { - uint32_t v; - int8_t status = stdlib_ndarray_iget_uint32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( v != 0 ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( uint32_t, ( in1 != 0 ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_u_x_0d, - stdlib_ndarray_every_u_x_1d, - stdlib_ndarray_every_u_x_2d, - stdlib_ndarray_every_u_x_3d, - stdlib_ndarray_every_u_x_4d, - stdlib_ndarray_every_u_x_5d, - stdlib_ndarray_every_u_x_6d, - stdlib_ndarray_every_u_x_7d, - stdlib_ndarray_every_u_x_8d, - stdlib_ndarray_every_u_x_9d, - stdlib_ndarray_every_u_x_10d, - stdlib_ndarray_every_u_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_u_x_2d_blocked, - stdlib_ndarray_every_u_x_3d_blocked, - stdlib_ndarray_every_u_x_4d_blocked, - stdlib_ndarray_every_u_x_5d_blocked, - stdlib_ndarray_every_u_x_6d_blocked, - stdlib_ndarray_every_u_x_7d_blocked, - stdlib_ndarray_every_u_x_8d_blocked, - stdlib_ndarray_every_u_x_9d_blocked, - stdlib_ndarray_every_u_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_u_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_u_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/x_x.c b/src/inline/x_x.c deleted file mode 100644 index d1659ec..0000000 --- a/src/inline/x_x.c +++ /dev/null @@ -1,2061 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/x_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_0d( struct ndarray *arrays[], void *data ) { - bool v; - int8_t status = stdlib_ndarray_iget_bool( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, v ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( bool, in1 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( bool, in1 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_x_x_0d, - stdlib_ndarray_every_x_x_1d, - stdlib_ndarray_every_x_x_2d, - stdlib_ndarray_every_x_x_3d, - stdlib_ndarray_every_x_x_4d, - stdlib_ndarray_every_x_x_5d, - stdlib_ndarray_every_x_x_6d, - stdlib_ndarray_every_x_x_7d, - stdlib_ndarray_every_x_x_8d, - stdlib_ndarray_every_x_x_9d, - stdlib_ndarray_every_x_x_10d, - stdlib_ndarray_every_x_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_x_x_2d_blocked, - stdlib_ndarray_every_x_x_3d_blocked, - stdlib_ndarray_every_x_x_4d_blocked, - stdlib_ndarray_every_x_x_5d_blocked, - stdlib_ndarray_every_x_x_6d_blocked, - stdlib_ndarray_every_x_x_7d_blocked, - stdlib_ndarray_every_x_x_8d_blocked, - stdlib_ndarray_every_x_x_9d_blocked, - stdlib_ndarray_every_x_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_x_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_x_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/inline/z_x.c b/src/inline/z_x.c deleted file mode 100644 index 40c50b6..0000000 --- a/src/inline/z_x.c +++ /dev/null @@ -1,2086 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/inline_loops.js. -*/ - -#include "stdlib/ndarray/base/every/inline/z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include "stdlib/complex/float64/real.h" -#include "stdlib/complex/float64/imag.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_0d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_0d( struct ndarray *arrays[], void *data ) { - stdlib_complex128_t v; - int8_t status = stdlib_ndarray_iget_complex128( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, ( stdlib_complex128_real( v ) != 0.0 || stdlib_complex128_imag( v ) != 0.0 ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_1d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_1d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_1D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_2d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_2d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_2d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_2d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_3d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_3d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_3d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_3d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_4d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_4d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_4d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_4d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_5d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_5d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_5d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_5d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_6d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_6d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_6d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_6d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_7d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_7d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_7d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_7d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_8d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_8d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_8d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_8d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_9d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_9d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_9d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_9d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_10d( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_10d( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_10d_blocked( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_10d_blocked( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x_nd( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x_nd( struct ndarray *arrays[], void *data ) { - STDLIB_NDARRAY_EVERY_ND_LOOP_INLINE( stdlib_complex128_t, ( stdlib_complex128_real( in1 ) != 0.0 || stdlib_complex128_imag( in1 ) != 0.0 ) ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_z_x_0d, - stdlib_ndarray_every_z_x_1d, - stdlib_ndarray_every_z_x_2d, - stdlib_ndarray_every_z_x_3d, - stdlib_ndarray_every_z_x_4d, - stdlib_ndarray_every_z_x_5d, - stdlib_ndarray_every_z_x_6d, - stdlib_ndarray_every_z_x_7d, - stdlib_ndarray_every_z_x_8d, - stdlib_ndarray_every_z_x_9d, - stdlib_ndarray_every_z_x_10d, - stdlib_ndarray_every_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_z_x_2d_blocked, - stdlib_ndarray_every_z_x_3d_blocked, - stdlib_ndarray_every_z_x_4d_blocked, - stdlib_ndarray_every_z_x_5d_blocked, - stdlib_ndarray_every_z_x_6d_blocked, - stdlib_ndarray_every_z_x_7d_blocked, - stdlib_ndarray_every_z_x_8d_blocked, - stdlib_ndarray_every_z_x_9d_blocked, - stdlib_ndarray_every_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param data function data -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/inline/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_z_x( arrays, NULL ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_z_x( struct ndarray *arrays[], void *data ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, data ); -} diff --git a/src/internal/permute.c b/src/internal/permute.c deleted file mode 100644 index ffe9688..0000000 --- a/src/internal/permute.c +++ /dev/null @@ -1,35 +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. -*/ - -#include "stdlib/ndarray/base/every/internal/permute.h" -#include - -/** -* Permutes an input array according to a provided index array. -* -* @param n number of elements to permute -* @param arr input array -* @param idx permutation indices -* @param out output array -*/ -void stdlib_ndarray_base_every_internal_permute( const int64_t n, const int64_t *arr, const int64_t *idx, int64_t *out ) { - int64_t i; - for ( i = 0; i < n; i++ ) { - out[ i ] = arr[ idx[i] ]; - } -} diff --git a/src/internal/range.c b/src/internal/range.c deleted file mode 100644 index 464149e..0000000 --- a/src/internal/range.c +++ /dev/null @@ -1,33 +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. -*/ - -#include "stdlib/ndarray/base/every/internal/range.h" -#include - -/** -* Writes `n` evenly spaced values from `0` to `n-1` to an output array. -* -* @param n number of values to write -* @param out output array -*/ -void stdlib_ndarray_base_every_internal_range( const int64_t n, int64_t *out ) { - int64_t i; - for ( i = 0; i < n; i++ ) { - out[ i ] = i; - } -} diff --git a/src/internal/sort2ins.c b/src/internal/sort2ins.c deleted file mode 100644 index 239662b..0000000 --- a/src/internal/sort2ins.c +++ /dev/null @@ -1,79 +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. -*/ - -#include "stdlib/ndarray/base/every/internal/sort2ins.h" -#include - -/** -* Simultaneously sorts two arrays based on the sort order of the first array using insertion sort. -* -* ## Notes -* -* - The first array is sorted in increasing order according to absolute value. -* - The algorithm has space complexity `O(1)` and worst case time complexity `O(N^2)`. -* - The algorithm is efficient for small arrays (typically `N <= 20`) and is particularly efficient for sorting arrays which are already substantially sorted. -* - The algorithm is **stable**, meaning that the algorithm does **not** change the order of array elements which are equal or equivalent. -* - The input arrays are sorted in-place (i.e., the input arrays are mutated). -* -* @param n number of elements -* @param x first array -* @param y second array -*/ -void stdlib_ndarray_base_every_internal_sort2ins( const int64_t n, int64_t *x, int64_t *y ) { - int64_t avx; - int64_t aux; - int64_t ix; - int64_t iy; - int64_t jx; - int64_t jy; - int64_t vx; - int64_t vy; - int64_t ux; - int64_t i; - - ix = 1; - iy = 1; - - // Sort in increasing order... - for ( i = 1; i < n; i++ ) { - vx = x[ ix ]; - avx = ( vx < 0 ) ? -vx : vx; - - vy = y[ iy ]; - - jx = ix - 1; - jy = iy - 1; - - // Shift all larger values to the left of the current element to the right... - while ( jx >= 0 ) { - ux = x[ jx ]; - aux = ( ux < 0 ) ? -ux : ux; - if ( aux <= avx ) { - break; - } - x[ jx+1 ] = ux; - y[ jy+1 ] = y[ jy ]; - jx -= 1; - jy -= 1; - } - x[ jx+1 ] = vx; - y[ jy+1 ] = vy; - ix += 1; - iy += 1; - } -} diff --git a/src/predicate/b_x.c b/src/predicate/b_x.c deleted file mode 100644 index a2f589d..0000000 --- a/src/predicate/b_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( uint8_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( uint8_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_0d, - stdlib_ndarray_every_by_b_x_1d, - stdlib_ndarray_every_by_b_x_2d, - stdlib_ndarray_every_by_b_x_3d, - stdlib_ndarray_every_by_b_x_4d, - stdlib_ndarray_every_by_b_x_5d, - stdlib_ndarray_every_by_b_x_6d, - stdlib_ndarray_every_by_b_x_7d, - stdlib_ndarray_every_by_b_x_8d, - stdlib_ndarray_every_by_b_x_9d, - stdlib_ndarray_every_by_b_x_10d, - stdlib_ndarray_every_by_b_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_2d_blocked, - stdlib_ndarray_every_by_b_x_3d_blocked, - stdlib_ndarray_every_by_b_x_4d_blocked, - stdlib_ndarray_every_by_b_x_5d_blocked, - stdlib_ndarray_every_by_b_x_6d_blocked, - stdlib_ndarray_every_by_b_x_7d_blocked, - stdlib_ndarray_every_by_b_x_8d_blocked, - stdlib_ndarray_every_by_b_x_9d_blocked, - stdlib_ndarray_every_by_b_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/b_x_as_c_x.c b/src/predicate/b_x_as_c_x.c deleted file mode 100644 index d9916ff..0000000 --- a/src/predicate/b_x_as_c_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex64_from_uint8( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex64_from_uint8 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_as_c_x_0d, - stdlib_ndarray_every_by_b_x_as_c_x_1d, - stdlib_ndarray_every_by_b_x_as_c_x_2d, - stdlib_ndarray_every_by_b_x_as_c_x_3d, - stdlib_ndarray_every_by_b_x_as_c_x_4d, - stdlib_ndarray_every_by_b_x_as_c_x_5d, - stdlib_ndarray_every_by_b_x_as_c_x_6d, - stdlib_ndarray_every_by_b_x_as_c_x_7d, - stdlib_ndarray_every_by_b_x_as_c_x_8d, - stdlib_ndarray_every_by_b_x_as_c_x_9d, - stdlib_ndarray_every_by_b_x_as_c_x_10d, - stdlib_ndarray_every_by_b_x_as_c_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_as_c_x_2d_blocked, - stdlib_ndarray_every_by_b_x_as_c_x_3d_blocked, - stdlib_ndarray_every_by_b_x_as_c_x_4d_blocked, - stdlib_ndarray_every_by_b_x_as_c_x_5d_blocked, - stdlib_ndarray_every_by_b_x_as_c_x_6d_blocked, - stdlib_ndarray_every_by_b_x_as_c_x_7d_blocked, - stdlib_ndarray_every_by_b_x_as_c_x_8d_blocked, - stdlib_ndarray_every_by_b_x_as_c_x_9d_blocked, - stdlib_ndarray_every_by_b_x_as_c_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_c_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_c_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/b_x_as_d_x.c b/src/predicate/b_x_as_d_x.c deleted file mode 100644 index 5a86232..0000000 --- a/src/predicate/b_x_as_d_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (double)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint8_t, double ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_as_d_x_0d, - stdlib_ndarray_every_by_b_x_as_d_x_1d, - stdlib_ndarray_every_by_b_x_as_d_x_2d, - stdlib_ndarray_every_by_b_x_as_d_x_3d, - stdlib_ndarray_every_by_b_x_as_d_x_4d, - stdlib_ndarray_every_by_b_x_as_d_x_5d, - stdlib_ndarray_every_by_b_x_as_d_x_6d, - stdlib_ndarray_every_by_b_x_as_d_x_7d, - stdlib_ndarray_every_by_b_x_as_d_x_8d, - stdlib_ndarray_every_by_b_x_as_d_x_9d, - stdlib_ndarray_every_by_b_x_as_d_x_10d, - stdlib_ndarray_every_by_b_x_as_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_as_d_x_2d_blocked, - stdlib_ndarray_every_by_b_x_as_d_x_3d_blocked, - stdlib_ndarray_every_by_b_x_as_d_x_4d_blocked, - stdlib_ndarray_every_by_b_x_as_d_x_5d_blocked, - stdlib_ndarray_every_by_b_x_as_d_x_6d_blocked, - stdlib_ndarray_every_by_b_x_as_d_x_7d_blocked, - stdlib_ndarray_every_by_b_x_as_d_x_8d_blocked, - stdlib_ndarray_every_by_b_x_as_d_x_9d_blocked, - stdlib_ndarray_every_by_b_x_as_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_d_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_d_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/b_x_as_f_x.c b/src/predicate/b_x_as_f_x.c deleted file mode 100644 index a7a0c7d..0000000 --- a/src/predicate/b_x_as_f_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (float)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint8_t, float ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_as_f_x_0d, - stdlib_ndarray_every_by_b_x_as_f_x_1d, - stdlib_ndarray_every_by_b_x_as_f_x_2d, - stdlib_ndarray_every_by_b_x_as_f_x_3d, - stdlib_ndarray_every_by_b_x_as_f_x_4d, - stdlib_ndarray_every_by_b_x_as_f_x_5d, - stdlib_ndarray_every_by_b_x_as_f_x_6d, - stdlib_ndarray_every_by_b_x_as_f_x_7d, - stdlib_ndarray_every_by_b_x_as_f_x_8d, - stdlib_ndarray_every_by_b_x_as_f_x_9d, - stdlib_ndarray_every_by_b_x_as_f_x_10d, - stdlib_ndarray_every_by_b_x_as_f_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_as_f_x_2d_blocked, - stdlib_ndarray_every_by_b_x_as_f_x_3d_blocked, - stdlib_ndarray_every_by_b_x_as_f_x_4d_blocked, - stdlib_ndarray_every_by_b_x_as_f_x_5d_blocked, - stdlib_ndarray_every_by_b_x_as_f_x_6d_blocked, - stdlib_ndarray_every_by_b_x_as_f_x_7d_blocked, - stdlib_ndarray_every_by_b_x_as_f_x_8d_blocked, - stdlib_ndarray_every_by_b_x_as_f_x_9d_blocked, - stdlib_ndarray_every_by_b_x_as_f_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_f_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_f_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/b_x_as_i_x.c b/src/predicate/b_x_as_i_x.c deleted file mode 100644 index 27c327f..0000000 --- a/src/predicate/b_x_as_i_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (int32_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint8_t, int32_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_as_i_x_0d, - stdlib_ndarray_every_by_b_x_as_i_x_1d, - stdlib_ndarray_every_by_b_x_as_i_x_2d, - stdlib_ndarray_every_by_b_x_as_i_x_3d, - stdlib_ndarray_every_by_b_x_as_i_x_4d, - stdlib_ndarray_every_by_b_x_as_i_x_5d, - stdlib_ndarray_every_by_b_x_as_i_x_6d, - stdlib_ndarray_every_by_b_x_as_i_x_7d, - stdlib_ndarray_every_by_b_x_as_i_x_8d, - stdlib_ndarray_every_by_b_x_as_i_x_9d, - stdlib_ndarray_every_by_b_x_as_i_x_10d, - stdlib_ndarray_every_by_b_x_as_i_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_as_i_x_2d_blocked, - stdlib_ndarray_every_by_b_x_as_i_x_3d_blocked, - stdlib_ndarray_every_by_b_x_as_i_x_4d_blocked, - stdlib_ndarray_every_by_b_x_as_i_x_5d_blocked, - stdlib_ndarray_every_by_b_x_as_i_x_6d_blocked, - stdlib_ndarray_every_by_b_x_as_i_x_7d_blocked, - stdlib_ndarray_every_by_b_x_as_i_x_8d_blocked, - stdlib_ndarray_every_by_b_x_as_i_x_9d_blocked, - stdlib_ndarray_every_by_b_x_as_i_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_i_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_i_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/b_x_as_k_x.c b/src/predicate/b_x_as_k_x.c deleted file mode 100644 index 407743f..0000000 --- a/src/predicate/b_x_as_k_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (int16_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint8_t, int16_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_as_k_x_0d, - stdlib_ndarray_every_by_b_x_as_k_x_1d, - stdlib_ndarray_every_by_b_x_as_k_x_2d, - stdlib_ndarray_every_by_b_x_as_k_x_3d, - stdlib_ndarray_every_by_b_x_as_k_x_4d, - stdlib_ndarray_every_by_b_x_as_k_x_5d, - stdlib_ndarray_every_by_b_x_as_k_x_6d, - stdlib_ndarray_every_by_b_x_as_k_x_7d, - stdlib_ndarray_every_by_b_x_as_k_x_8d, - stdlib_ndarray_every_by_b_x_as_k_x_9d, - stdlib_ndarray_every_by_b_x_as_k_x_10d, - stdlib_ndarray_every_by_b_x_as_k_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_as_k_x_2d_blocked, - stdlib_ndarray_every_by_b_x_as_k_x_3d_blocked, - stdlib_ndarray_every_by_b_x_as_k_x_4d_blocked, - stdlib_ndarray_every_by_b_x_as_k_x_5d_blocked, - stdlib_ndarray_every_by_b_x_as_k_x_6d_blocked, - stdlib_ndarray_every_by_b_x_as_k_x_7d_blocked, - stdlib_ndarray_every_by_b_x_as_k_x_8d_blocked, - stdlib_ndarray_every_by_b_x_as_k_x_9d_blocked, - stdlib_ndarray_every_by_b_x_as_k_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_k_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_k_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/b_x_as_t_x.c b/src/predicate/b_x_as_t_x.c deleted file mode 100644 index fd8ce82..0000000 --- a/src/predicate/b_x_as_t_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (uint16_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint8_t, uint16_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_as_t_x_0d, - stdlib_ndarray_every_by_b_x_as_t_x_1d, - stdlib_ndarray_every_by_b_x_as_t_x_2d, - stdlib_ndarray_every_by_b_x_as_t_x_3d, - stdlib_ndarray_every_by_b_x_as_t_x_4d, - stdlib_ndarray_every_by_b_x_as_t_x_5d, - stdlib_ndarray_every_by_b_x_as_t_x_6d, - stdlib_ndarray_every_by_b_x_as_t_x_7d, - stdlib_ndarray_every_by_b_x_as_t_x_8d, - stdlib_ndarray_every_by_b_x_as_t_x_9d, - stdlib_ndarray_every_by_b_x_as_t_x_10d, - stdlib_ndarray_every_by_b_x_as_t_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_as_t_x_2d_blocked, - stdlib_ndarray_every_by_b_x_as_t_x_3d_blocked, - stdlib_ndarray_every_by_b_x_as_t_x_4d_blocked, - stdlib_ndarray_every_by_b_x_as_t_x_5d_blocked, - stdlib_ndarray_every_by_b_x_as_t_x_6d_blocked, - stdlib_ndarray_every_by_b_x_as_t_x_7d_blocked, - stdlib_ndarray_every_by_b_x_as_t_x_8d_blocked, - stdlib_ndarray_every_by_b_x_as_t_x_9d_blocked, - stdlib_ndarray_every_by_b_x_as_t_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_t_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_t_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/b_x_as_u_x.c b/src/predicate/b_x_as_u_x.c deleted file mode 100644 index f4cbc3b..0000000 --- a/src/predicate/b_x_as_u_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (uint32_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint8_t, uint32_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_as_u_x_0d, - stdlib_ndarray_every_by_b_x_as_u_x_1d, - stdlib_ndarray_every_by_b_x_as_u_x_2d, - stdlib_ndarray_every_by_b_x_as_u_x_3d, - stdlib_ndarray_every_by_b_x_as_u_x_4d, - stdlib_ndarray_every_by_b_x_as_u_x_5d, - stdlib_ndarray_every_by_b_x_as_u_x_6d, - stdlib_ndarray_every_by_b_x_as_u_x_7d, - stdlib_ndarray_every_by_b_x_as_u_x_8d, - stdlib_ndarray_every_by_b_x_as_u_x_9d, - stdlib_ndarray_every_by_b_x_as_u_x_10d, - stdlib_ndarray_every_by_b_x_as_u_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_as_u_x_2d_blocked, - stdlib_ndarray_every_by_b_x_as_u_x_3d_blocked, - stdlib_ndarray_every_by_b_x_as_u_x_4d_blocked, - stdlib_ndarray_every_by_b_x_as_u_x_5d_blocked, - stdlib_ndarray_every_by_b_x_as_u_x_6d_blocked, - stdlib_ndarray_every_by_b_x_as_u_x_7d_blocked, - stdlib_ndarray_every_by_b_x_as_u_x_8d_blocked, - stdlib_ndarray_every_by_b_x_as_u_x_9d_blocked, - stdlib_ndarray_every_by_b_x_as_u_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_u_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_u_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/b_x_as_z_x.c b/src/predicate/b_x_as_z_x.c deleted file mode 100644 index 1ccc19c..0000000 --- a/src/predicate/b_x_as_z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - uint8_t v; - int8_t status = stdlib_ndarray_iget_uint8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_uint8( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( uint8_t, stdlib_complex128_from_uint8 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_b_x_as_z_x_0d, - stdlib_ndarray_every_by_b_x_as_z_x_1d, - stdlib_ndarray_every_by_b_x_as_z_x_2d, - stdlib_ndarray_every_by_b_x_as_z_x_3d, - stdlib_ndarray_every_by_b_x_as_z_x_4d, - stdlib_ndarray_every_by_b_x_as_z_x_5d, - stdlib_ndarray_every_by_b_x_as_z_x_6d, - stdlib_ndarray_every_by_b_x_as_z_x_7d, - stdlib_ndarray_every_by_b_x_as_z_x_8d, - stdlib_ndarray_every_by_b_x_as_z_x_9d, - stdlib_ndarray_every_by_b_x_as_z_x_10d, - stdlib_ndarray_every_by_b_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_b_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_b_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_b_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_b_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_b_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_b_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_b_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_b_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_b_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/b_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_b_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_b_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/c_x.c b/src/predicate/c_x.c deleted file mode 100644 index b747fdb..0000000 --- a/src/predicate/c_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/c_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_0d( struct ndarray *arrays[], void *fcn ) { - stdlib_complex64_t v; - int8_t status = stdlib_ndarray_iget_complex64( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( stdlib_complex64_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_c_x_0d, - stdlib_ndarray_every_by_c_x_1d, - stdlib_ndarray_every_by_c_x_2d, - stdlib_ndarray_every_by_c_x_3d, - stdlib_ndarray_every_by_c_x_4d, - stdlib_ndarray_every_by_c_x_5d, - stdlib_ndarray_every_by_c_x_6d, - stdlib_ndarray_every_by_c_x_7d, - stdlib_ndarray_every_by_c_x_8d, - stdlib_ndarray_every_by_c_x_9d, - stdlib_ndarray_every_by_c_x_10d, - stdlib_ndarray_every_by_c_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_c_x_2d_blocked, - stdlib_ndarray_every_by_c_x_3d_blocked, - stdlib_ndarray_every_by_c_x_4d_blocked, - stdlib_ndarray_every_by_c_x_5d_blocked, - stdlib_ndarray_every_by_c_x_6d_blocked, - stdlib_ndarray_every_by_c_x_7d_blocked, - stdlib_ndarray_every_by_c_x_8d_blocked, - stdlib_ndarray_every_by_c_x_9d_blocked, - stdlib_ndarray_every_by_c_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/c_x_as_z_x.c b/src/predicate/c_x_as_z_x.c deleted file mode 100644 index 7a5d822..0000000 --- a/src/predicate/c_x_as_z_x.c +++ /dev/null @@ -1,2237 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - stdlib_complex64_t v; - int8_t status = stdlib_ndarray_iget_complex64( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_complex64( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( stdlib_complex64_t, stdlib_complex128_from_complex64 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_c_x_as_z_x_0d, - stdlib_ndarray_every_by_c_x_as_z_x_1d, - stdlib_ndarray_every_by_c_x_as_z_x_2d, - stdlib_ndarray_every_by_c_x_as_z_x_3d, - stdlib_ndarray_every_by_c_x_as_z_x_4d, - stdlib_ndarray_every_by_c_x_as_z_x_5d, - stdlib_ndarray_every_by_c_x_as_z_x_6d, - stdlib_ndarray_every_by_c_x_as_z_x_7d, - stdlib_ndarray_every_by_c_x_as_z_x_8d, - stdlib_ndarray_every_by_c_x_as_z_x_9d, - stdlib_ndarray_every_by_c_x_as_z_x_10d, - stdlib_ndarray_every_by_c_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_c_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_c_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_c_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_c_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_c_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_c_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_c_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_c_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_c_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/c_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_c_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_c_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/d_x.c b/src/predicate/d_x.c deleted file mode 100644 index 2de418c..0000000 --- a/src/predicate/d_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_0d( struct ndarray *arrays[], void *fcn ) { - double v; - int8_t status = stdlib_ndarray_iget_float64( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( double ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( double ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_d_x_0d, - stdlib_ndarray_every_by_d_x_1d, - stdlib_ndarray_every_by_d_x_2d, - stdlib_ndarray_every_by_d_x_3d, - stdlib_ndarray_every_by_d_x_4d, - stdlib_ndarray_every_by_d_x_5d, - stdlib_ndarray_every_by_d_x_6d, - stdlib_ndarray_every_by_d_x_7d, - stdlib_ndarray_every_by_d_x_8d, - stdlib_ndarray_every_by_d_x_9d, - stdlib_ndarray_every_by_d_x_10d, - stdlib_ndarray_every_by_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_d_x_2d_blocked, - stdlib_ndarray_every_by_d_x_3d_blocked, - stdlib_ndarray_every_by_d_x_4d_blocked, - stdlib_ndarray_every_by_d_x_5d_blocked, - stdlib_ndarray_every_by_d_x_6d_blocked, - stdlib_ndarray_every_by_d_x_7d_blocked, - stdlib_ndarray_every_by_d_x_8d_blocked, - stdlib_ndarray_every_by_d_x_9d_blocked, - stdlib_ndarray_every_by_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/d_x_as_z_x.c b/src/predicate/d_x_as_z_x.c deleted file mode 100644 index 69f679d..0000000 --- a/src/predicate/d_x_as_z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - double v; - int8_t status = stdlib_ndarray_iget_float64( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_float64( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 64, 64, 64, 64, 64, 64, 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( double, stdlib_complex128_from_float64 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_d_x_as_z_x_0d, - stdlib_ndarray_every_by_d_x_as_z_x_1d, - stdlib_ndarray_every_by_d_x_as_z_x_2d, - stdlib_ndarray_every_by_d_x_as_z_x_3d, - stdlib_ndarray_every_by_d_x_as_z_x_4d, - stdlib_ndarray_every_by_d_x_as_z_x_5d, - stdlib_ndarray_every_by_d_x_as_z_x_6d, - stdlib_ndarray_every_by_d_x_as_z_x_7d, - stdlib_ndarray_every_by_d_x_as_z_x_8d, - stdlib_ndarray_every_by_d_x_as_z_x_9d, - stdlib_ndarray_every_by_d_x_as_z_x_10d, - stdlib_ndarray_every_by_d_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_d_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_d_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_d_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_d_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_d_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_d_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_d_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_d_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_d_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/d_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT64; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_d_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_d_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/f_x.c b/src/predicate/f_x.c deleted file mode 100644 index 4fa71a7..0000000 --- a/src/predicate/f_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/f_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_0d( struct ndarray *arrays[], void *fcn ) { - float v; - int8_t status = stdlib_ndarray_iget_float32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( float ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( float ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_f_x_0d, - stdlib_ndarray_every_by_f_x_1d, - stdlib_ndarray_every_by_f_x_2d, - stdlib_ndarray_every_by_f_x_3d, - stdlib_ndarray_every_by_f_x_4d, - stdlib_ndarray_every_by_f_x_5d, - stdlib_ndarray_every_by_f_x_6d, - stdlib_ndarray_every_by_f_x_7d, - stdlib_ndarray_every_by_f_x_8d, - stdlib_ndarray_every_by_f_x_9d, - stdlib_ndarray_every_by_f_x_10d, - stdlib_ndarray_every_by_f_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_f_x_2d_blocked, - stdlib_ndarray_every_by_f_x_3d_blocked, - stdlib_ndarray_every_by_f_x_4d_blocked, - stdlib_ndarray_every_by_f_x_5d_blocked, - stdlib_ndarray_every_by_f_x_6d_blocked, - stdlib_ndarray_every_by_f_x_7d_blocked, - stdlib_ndarray_every_by_f_x_8d_blocked, - stdlib_ndarray_every_by_f_x_9d_blocked, - stdlib_ndarray_every_by_f_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/f_x_as_c_x.c b/src/predicate/f_x_as_c_x.c deleted file mode 100644 index b475bf9..0000000 --- a/src/predicate/f_x_as_c_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ) { - float v; - int8_t status = stdlib_ndarray_iget_float32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex64_from_float32( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex64_from_float32 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_f_x_as_c_x_0d, - stdlib_ndarray_every_by_f_x_as_c_x_1d, - stdlib_ndarray_every_by_f_x_as_c_x_2d, - stdlib_ndarray_every_by_f_x_as_c_x_3d, - stdlib_ndarray_every_by_f_x_as_c_x_4d, - stdlib_ndarray_every_by_f_x_as_c_x_5d, - stdlib_ndarray_every_by_f_x_as_c_x_6d, - stdlib_ndarray_every_by_f_x_as_c_x_7d, - stdlib_ndarray_every_by_f_x_as_c_x_8d, - stdlib_ndarray_every_by_f_x_as_c_x_9d, - stdlib_ndarray_every_by_f_x_as_c_x_10d, - stdlib_ndarray_every_by_f_x_as_c_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_f_x_as_c_x_2d_blocked, - stdlib_ndarray_every_by_f_x_as_c_x_3d_blocked, - stdlib_ndarray_every_by_f_x_as_c_x_4d_blocked, - stdlib_ndarray_every_by_f_x_as_c_x_5d_blocked, - stdlib_ndarray_every_by_f_x_as_c_x_6d_blocked, - stdlib_ndarray_every_by_f_x_as_c_x_7d_blocked, - stdlib_ndarray_every_by_f_x_as_c_x_8d_blocked, - stdlib_ndarray_every_by_f_x_as_c_x_9d_blocked, - stdlib_ndarray_every_by_f_x_as_c_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_c_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_c_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/f_x_as_d_x.c b/src/predicate/f_x_as_d_x.c deleted file mode 100644 index c73e4f6..0000000 --- a/src/predicate/f_x_as_d_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ) { - float v; - int8_t status = stdlib_ndarray_iget_float32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (double)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( float, double ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_f_x_as_d_x_0d, - stdlib_ndarray_every_by_f_x_as_d_x_1d, - stdlib_ndarray_every_by_f_x_as_d_x_2d, - stdlib_ndarray_every_by_f_x_as_d_x_3d, - stdlib_ndarray_every_by_f_x_as_d_x_4d, - stdlib_ndarray_every_by_f_x_as_d_x_5d, - stdlib_ndarray_every_by_f_x_as_d_x_6d, - stdlib_ndarray_every_by_f_x_as_d_x_7d, - stdlib_ndarray_every_by_f_x_as_d_x_8d, - stdlib_ndarray_every_by_f_x_as_d_x_9d, - stdlib_ndarray_every_by_f_x_as_d_x_10d, - stdlib_ndarray_every_by_f_x_as_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_f_x_as_d_x_2d_blocked, - stdlib_ndarray_every_by_f_x_as_d_x_3d_blocked, - stdlib_ndarray_every_by_f_x_as_d_x_4d_blocked, - stdlib_ndarray_every_by_f_x_as_d_x_5d_blocked, - stdlib_ndarray_every_by_f_x_as_d_x_6d_blocked, - stdlib_ndarray_every_by_f_x_as_d_x_7d_blocked, - stdlib_ndarray_every_by_f_x_as_d_x_8d_blocked, - stdlib_ndarray_every_by_f_x_as_d_x_9d_blocked, - stdlib_ndarray_every_by_f_x_as_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_d_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_d_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/f_x_as_z_x.c b/src/predicate/f_x_as_z_x.c deleted file mode 100644 index f1c3542..0000000 --- a/src/predicate/f_x_as_z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - float v; - int8_t status = stdlib_ndarray_iget_float32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_float32( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( float, stdlib_complex128_from_float32 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_f_x_as_z_x_0d, - stdlib_ndarray_every_by_f_x_as_z_x_1d, - stdlib_ndarray_every_by_f_x_as_z_x_2d, - stdlib_ndarray_every_by_f_x_as_z_x_3d, - stdlib_ndarray_every_by_f_x_as_z_x_4d, - stdlib_ndarray_every_by_f_x_as_z_x_5d, - stdlib_ndarray_every_by_f_x_as_z_x_6d, - stdlib_ndarray_every_by_f_x_as_z_x_7d, - stdlib_ndarray_every_by_f_x_as_z_x_8d, - stdlib_ndarray_every_by_f_x_as_z_x_9d, - stdlib_ndarray_every_by_f_x_as_z_x_10d, - stdlib_ndarray_every_by_f_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_f_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_f_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_f_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_f_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_f_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_f_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_f_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_f_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_f_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/f_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_FLOAT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_f_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_f_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/i_x.c b/src/predicate/i_x.c deleted file mode 100644 index 31ae985..0000000 --- a/src/predicate/i_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/i_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_0d( struct ndarray *arrays[], void *fcn ) { - int32_t v; - int8_t status = stdlib_ndarray_iget_int32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( int32_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( int32_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_i_x_0d, - stdlib_ndarray_every_by_i_x_1d, - stdlib_ndarray_every_by_i_x_2d, - stdlib_ndarray_every_by_i_x_3d, - stdlib_ndarray_every_by_i_x_4d, - stdlib_ndarray_every_by_i_x_5d, - stdlib_ndarray_every_by_i_x_6d, - stdlib_ndarray_every_by_i_x_7d, - stdlib_ndarray_every_by_i_x_8d, - stdlib_ndarray_every_by_i_x_9d, - stdlib_ndarray_every_by_i_x_10d, - stdlib_ndarray_every_by_i_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_i_x_2d_blocked, - stdlib_ndarray_every_by_i_x_3d_blocked, - stdlib_ndarray_every_by_i_x_4d_blocked, - stdlib_ndarray_every_by_i_x_5d_blocked, - stdlib_ndarray_every_by_i_x_6d_blocked, - stdlib_ndarray_every_by_i_x_7d_blocked, - stdlib_ndarray_every_by_i_x_8d_blocked, - stdlib_ndarray_every_by_i_x_9d_blocked, - stdlib_ndarray_every_by_i_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/i_x_as_d_x.c b/src/predicate/i_x_as_d_x.c deleted file mode 100644 index 2ff7bf8..0000000 --- a/src/predicate/i_x_as_d_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ) { - int32_t v; - int8_t status = stdlib_ndarray_iget_int32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (double)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( int32_t, double ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_i_x_as_d_x_0d, - stdlib_ndarray_every_by_i_x_as_d_x_1d, - stdlib_ndarray_every_by_i_x_as_d_x_2d, - stdlib_ndarray_every_by_i_x_as_d_x_3d, - stdlib_ndarray_every_by_i_x_as_d_x_4d, - stdlib_ndarray_every_by_i_x_as_d_x_5d, - stdlib_ndarray_every_by_i_x_as_d_x_6d, - stdlib_ndarray_every_by_i_x_as_d_x_7d, - stdlib_ndarray_every_by_i_x_as_d_x_8d, - stdlib_ndarray_every_by_i_x_as_d_x_9d, - stdlib_ndarray_every_by_i_x_as_d_x_10d, - stdlib_ndarray_every_by_i_x_as_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_i_x_as_d_x_2d_blocked, - stdlib_ndarray_every_by_i_x_as_d_x_3d_blocked, - stdlib_ndarray_every_by_i_x_as_d_x_4d_blocked, - stdlib_ndarray_every_by_i_x_as_d_x_5d_blocked, - stdlib_ndarray_every_by_i_x_as_d_x_6d_blocked, - stdlib_ndarray_every_by_i_x_as_d_x_7d_blocked, - stdlib_ndarray_every_by_i_x_as_d_x_8d_blocked, - stdlib_ndarray_every_by_i_x_as_d_x_9d_blocked, - stdlib_ndarray_every_by_i_x_as_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_d_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_d_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/i_x_as_z_x.c b/src/predicate/i_x_as_z_x.c deleted file mode 100644 index 54cb905..0000000 --- a/src/predicate/i_x_as_z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - int32_t v; - int8_t status = stdlib_ndarray_iget_int32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_int32( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( int32_t, stdlib_complex128_from_int32 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_i_x_as_z_x_0d, - stdlib_ndarray_every_by_i_x_as_z_x_1d, - stdlib_ndarray_every_by_i_x_as_z_x_2d, - stdlib_ndarray_every_by_i_x_as_z_x_3d, - stdlib_ndarray_every_by_i_x_as_z_x_4d, - stdlib_ndarray_every_by_i_x_as_z_x_5d, - stdlib_ndarray_every_by_i_x_as_z_x_6d, - stdlib_ndarray_every_by_i_x_as_z_x_7d, - stdlib_ndarray_every_by_i_x_as_z_x_8d, - stdlib_ndarray_every_by_i_x_as_z_x_9d, - stdlib_ndarray_every_by_i_x_as_z_x_10d, - stdlib_ndarray_every_by_i_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_i_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_i_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_i_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_i_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_i_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_i_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_i_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_i_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_i_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/i_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_i_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_i_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/k_x.c b/src/predicate/k_x.c deleted file mode 100644 index 9107bd4..0000000 --- a/src/predicate/k_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/k_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_0d( struct ndarray *arrays[], void *fcn ) { - int16_t v; - int8_t status = stdlib_ndarray_iget_int16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( int16_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( int16_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_k_x_0d, - stdlib_ndarray_every_by_k_x_1d, - stdlib_ndarray_every_by_k_x_2d, - stdlib_ndarray_every_by_k_x_3d, - stdlib_ndarray_every_by_k_x_4d, - stdlib_ndarray_every_by_k_x_5d, - stdlib_ndarray_every_by_k_x_6d, - stdlib_ndarray_every_by_k_x_7d, - stdlib_ndarray_every_by_k_x_8d, - stdlib_ndarray_every_by_k_x_9d, - stdlib_ndarray_every_by_k_x_10d, - stdlib_ndarray_every_by_k_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_k_x_2d_blocked, - stdlib_ndarray_every_by_k_x_3d_blocked, - stdlib_ndarray_every_by_k_x_4d_blocked, - stdlib_ndarray_every_by_k_x_5d_blocked, - stdlib_ndarray_every_by_k_x_6d_blocked, - stdlib_ndarray_every_by_k_x_7d_blocked, - stdlib_ndarray_every_by_k_x_8d_blocked, - stdlib_ndarray_every_by_k_x_9d_blocked, - stdlib_ndarray_every_by_k_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/k_x_as_c_x.c b/src/predicate/k_x_as_c_x.c deleted file mode 100644 index 5a6763b..0000000 --- a/src/predicate/k_x_as_c_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ) { - int16_t v; - int8_t status = stdlib_ndarray_iget_int16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex64_from_int16( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex64_from_int16 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_k_x_as_c_x_0d, - stdlib_ndarray_every_by_k_x_as_c_x_1d, - stdlib_ndarray_every_by_k_x_as_c_x_2d, - stdlib_ndarray_every_by_k_x_as_c_x_3d, - stdlib_ndarray_every_by_k_x_as_c_x_4d, - stdlib_ndarray_every_by_k_x_as_c_x_5d, - stdlib_ndarray_every_by_k_x_as_c_x_6d, - stdlib_ndarray_every_by_k_x_as_c_x_7d, - stdlib_ndarray_every_by_k_x_as_c_x_8d, - stdlib_ndarray_every_by_k_x_as_c_x_9d, - stdlib_ndarray_every_by_k_x_as_c_x_10d, - stdlib_ndarray_every_by_k_x_as_c_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_k_x_as_c_x_2d_blocked, - stdlib_ndarray_every_by_k_x_as_c_x_3d_blocked, - stdlib_ndarray_every_by_k_x_as_c_x_4d_blocked, - stdlib_ndarray_every_by_k_x_as_c_x_5d_blocked, - stdlib_ndarray_every_by_k_x_as_c_x_6d_blocked, - stdlib_ndarray_every_by_k_x_as_c_x_7d_blocked, - stdlib_ndarray_every_by_k_x_as_c_x_8d_blocked, - stdlib_ndarray_every_by_k_x_as_c_x_9d_blocked, - stdlib_ndarray_every_by_k_x_as_c_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_c_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_c_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/k_x_as_d_x.c b/src/predicate/k_x_as_d_x.c deleted file mode 100644 index 79685d8..0000000 --- a/src/predicate/k_x_as_d_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ) { - int16_t v; - int8_t status = stdlib_ndarray_iget_int16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (double)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( int16_t, double ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_k_x_as_d_x_0d, - stdlib_ndarray_every_by_k_x_as_d_x_1d, - stdlib_ndarray_every_by_k_x_as_d_x_2d, - stdlib_ndarray_every_by_k_x_as_d_x_3d, - stdlib_ndarray_every_by_k_x_as_d_x_4d, - stdlib_ndarray_every_by_k_x_as_d_x_5d, - stdlib_ndarray_every_by_k_x_as_d_x_6d, - stdlib_ndarray_every_by_k_x_as_d_x_7d, - stdlib_ndarray_every_by_k_x_as_d_x_8d, - stdlib_ndarray_every_by_k_x_as_d_x_9d, - stdlib_ndarray_every_by_k_x_as_d_x_10d, - stdlib_ndarray_every_by_k_x_as_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_k_x_as_d_x_2d_blocked, - stdlib_ndarray_every_by_k_x_as_d_x_3d_blocked, - stdlib_ndarray_every_by_k_x_as_d_x_4d_blocked, - stdlib_ndarray_every_by_k_x_as_d_x_5d_blocked, - stdlib_ndarray_every_by_k_x_as_d_x_6d_blocked, - stdlib_ndarray_every_by_k_x_as_d_x_7d_blocked, - stdlib_ndarray_every_by_k_x_as_d_x_8d_blocked, - stdlib_ndarray_every_by_k_x_as_d_x_9d_blocked, - stdlib_ndarray_every_by_k_x_as_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_d_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_d_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/k_x_as_f_x.c b/src/predicate/k_x_as_f_x.c deleted file mode 100644 index 6866ee6..0000000 --- a/src/predicate/k_x_as_f_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_0d( struct ndarray *arrays[], void *fcn ) { - int16_t v; - int8_t status = stdlib_ndarray_iget_int16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (float)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( int16_t, float ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_k_x_as_f_x_0d, - stdlib_ndarray_every_by_k_x_as_f_x_1d, - stdlib_ndarray_every_by_k_x_as_f_x_2d, - stdlib_ndarray_every_by_k_x_as_f_x_3d, - stdlib_ndarray_every_by_k_x_as_f_x_4d, - stdlib_ndarray_every_by_k_x_as_f_x_5d, - stdlib_ndarray_every_by_k_x_as_f_x_6d, - stdlib_ndarray_every_by_k_x_as_f_x_7d, - stdlib_ndarray_every_by_k_x_as_f_x_8d, - stdlib_ndarray_every_by_k_x_as_f_x_9d, - stdlib_ndarray_every_by_k_x_as_f_x_10d, - stdlib_ndarray_every_by_k_x_as_f_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_k_x_as_f_x_2d_blocked, - stdlib_ndarray_every_by_k_x_as_f_x_3d_blocked, - stdlib_ndarray_every_by_k_x_as_f_x_4d_blocked, - stdlib_ndarray_every_by_k_x_as_f_x_5d_blocked, - stdlib_ndarray_every_by_k_x_as_f_x_6d_blocked, - stdlib_ndarray_every_by_k_x_as_f_x_7d_blocked, - stdlib_ndarray_every_by_k_x_as_f_x_8d_blocked, - stdlib_ndarray_every_by_k_x_as_f_x_9d_blocked, - stdlib_ndarray_every_by_k_x_as_f_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_f_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_f_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/k_x_as_i_x.c b/src/predicate/k_x_as_i_x.c deleted file mode 100644 index d9909a9..0000000 --- a/src/predicate/k_x_as_i_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_0d( struct ndarray *arrays[], void *fcn ) { - int16_t v; - int8_t status = stdlib_ndarray_iget_int16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (int32_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( int16_t, int32_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_k_x_as_i_x_0d, - stdlib_ndarray_every_by_k_x_as_i_x_1d, - stdlib_ndarray_every_by_k_x_as_i_x_2d, - stdlib_ndarray_every_by_k_x_as_i_x_3d, - stdlib_ndarray_every_by_k_x_as_i_x_4d, - stdlib_ndarray_every_by_k_x_as_i_x_5d, - stdlib_ndarray_every_by_k_x_as_i_x_6d, - stdlib_ndarray_every_by_k_x_as_i_x_7d, - stdlib_ndarray_every_by_k_x_as_i_x_8d, - stdlib_ndarray_every_by_k_x_as_i_x_9d, - stdlib_ndarray_every_by_k_x_as_i_x_10d, - stdlib_ndarray_every_by_k_x_as_i_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_k_x_as_i_x_2d_blocked, - stdlib_ndarray_every_by_k_x_as_i_x_3d_blocked, - stdlib_ndarray_every_by_k_x_as_i_x_4d_blocked, - stdlib_ndarray_every_by_k_x_as_i_x_5d_blocked, - stdlib_ndarray_every_by_k_x_as_i_x_6d_blocked, - stdlib_ndarray_every_by_k_x_as_i_x_7d_blocked, - stdlib_ndarray_every_by_k_x_as_i_x_8d_blocked, - stdlib_ndarray_every_by_k_x_as_i_x_9d_blocked, - stdlib_ndarray_every_by_k_x_as_i_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_i_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_i_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/k_x_as_z_x.c b/src/predicate/k_x_as_z_x.c deleted file mode 100644 index d1ee999..0000000 --- a/src/predicate/k_x_as_z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - int16_t v; - int8_t status = stdlib_ndarray_iget_int16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_int16( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( int16_t, stdlib_complex128_from_int16 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_k_x_as_z_x_0d, - stdlib_ndarray_every_by_k_x_as_z_x_1d, - stdlib_ndarray_every_by_k_x_as_z_x_2d, - stdlib_ndarray_every_by_k_x_as_z_x_3d, - stdlib_ndarray_every_by_k_x_as_z_x_4d, - stdlib_ndarray_every_by_k_x_as_z_x_5d, - stdlib_ndarray_every_by_k_x_as_z_x_6d, - stdlib_ndarray_every_by_k_x_as_z_x_7d, - stdlib_ndarray_every_by_k_x_as_z_x_8d, - stdlib_ndarray_every_by_k_x_as_z_x_9d, - stdlib_ndarray_every_by_k_x_as_z_x_10d, - stdlib_ndarray_every_by_k_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_k_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_k_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_k_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_k_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_k_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_k_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_k_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_k_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_k_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/k_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_k_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_k_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/s_x.c b/src/predicate/s_x.c deleted file mode 100644 index 8b26ec4..0000000 --- a/src/predicate/s_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/s_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_0d( struct ndarray *arrays[], void *fcn ) { - int8_t v; - int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( int8_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int8_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( int8_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_s_x_0d, - stdlib_ndarray_every_by_s_x_1d, - stdlib_ndarray_every_by_s_x_2d, - stdlib_ndarray_every_by_s_x_3d, - stdlib_ndarray_every_by_s_x_4d, - stdlib_ndarray_every_by_s_x_5d, - stdlib_ndarray_every_by_s_x_6d, - stdlib_ndarray_every_by_s_x_7d, - stdlib_ndarray_every_by_s_x_8d, - stdlib_ndarray_every_by_s_x_9d, - stdlib_ndarray_every_by_s_x_10d, - stdlib_ndarray_every_by_s_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_s_x_2d_blocked, - stdlib_ndarray_every_by_s_x_3d_blocked, - stdlib_ndarray_every_by_s_x_4d_blocked, - stdlib_ndarray_every_by_s_x_5d_blocked, - stdlib_ndarray_every_by_s_x_6d_blocked, - stdlib_ndarray_every_by_s_x_7d_blocked, - stdlib_ndarray_every_by_s_x_8d_blocked, - stdlib_ndarray_every_by_s_x_9d_blocked, - stdlib_ndarray_every_by_s_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int8_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/s_x_as_c_x.c b/src/predicate/s_x_as_c_x.c deleted file mode 100644 index b80abd0..0000000 --- a/src/predicate/s_x_as_c_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ) { - int8_t v; - int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex64_from_int8( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex64_from_int8 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_s_x_as_c_x_0d, - stdlib_ndarray_every_by_s_x_as_c_x_1d, - stdlib_ndarray_every_by_s_x_as_c_x_2d, - stdlib_ndarray_every_by_s_x_as_c_x_3d, - stdlib_ndarray_every_by_s_x_as_c_x_4d, - stdlib_ndarray_every_by_s_x_as_c_x_5d, - stdlib_ndarray_every_by_s_x_as_c_x_6d, - stdlib_ndarray_every_by_s_x_as_c_x_7d, - stdlib_ndarray_every_by_s_x_as_c_x_8d, - stdlib_ndarray_every_by_s_x_as_c_x_9d, - stdlib_ndarray_every_by_s_x_as_c_x_10d, - stdlib_ndarray_every_by_s_x_as_c_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_s_x_as_c_x_2d_blocked, - stdlib_ndarray_every_by_s_x_as_c_x_3d_blocked, - stdlib_ndarray_every_by_s_x_as_c_x_4d_blocked, - stdlib_ndarray_every_by_s_x_as_c_x_5d_blocked, - stdlib_ndarray_every_by_s_x_as_c_x_6d_blocked, - stdlib_ndarray_every_by_s_x_as_c_x_7d_blocked, - stdlib_ndarray_every_by_s_x_as_c_x_8d_blocked, - stdlib_ndarray_every_by_s_x_as_c_x_9d_blocked, - stdlib_ndarray_every_by_s_x_as_c_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_c_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_c_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/s_x_as_d_x.c b/src/predicate/s_x_as_d_x.c deleted file mode 100644 index 590edbe..0000000 --- a/src/predicate/s_x_as_d_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ) { - int8_t v; - int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (double)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( int8_t, double ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_s_x_as_d_x_0d, - stdlib_ndarray_every_by_s_x_as_d_x_1d, - stdlib_ndarray_every_by_s_x_as_d_x_2d, - stdlib_ndarray_every_by_s_x_as_d_x_3d, - stdlib_ndarray_every_by_s_x_as_d_x_4d, - stdlib_ndarray_every_by_s_x_as_d_x_5d, - stdlib_ndarray_every_by_s_x_as_d_x_6d, - stdlib_ndarray_every_by_s_x_as_d_x_7d, - stdlib_ndarray_every_by_s_x_as_d_x_8d, - stdlib_ndarray_every_by_s_x_as_d_x_9d, - stdlib_ndarray_every_by_s_x_as_d_x_10d, - stdlib_ndarray_every_by_s_x_as_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_s_x_as_d_x_2d_blocked, - stdlib_ndarray_every_by_s_x_as_d_x_3d_blocked, - stdlib_ndarray_every_by_s_x_as_d_x_4d_blocked, - stdlib_ndarray_every_by_s_x_as_d_x_5d_blocked, - stdlib_ndarray_every_by_s_x_as_d_x_6d_blocked, - stdlib_ndarray_every_by_s_x_as_d_x_7d_blocked, - stdlib_ndarray_every_by_s_x_as_d_x_8d_blocked, - stdlib_ndarray_every_by_s_x_as_d_x_9d_blocked, - stdlib_ndarray_every_by_s_x_as_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_d_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_d_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/s_x_as_f_x.c b/src/predicate/s_x_as_f_x.c deleted file mode 100644 index da689d8..0000000 --- a/src/predicate/s_x_as_f_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_0d( struct ndarray *arrays[], void *fcn ) { - int8_t v; - int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (float)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( int8_t, float ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_s_x_as_f_x_0d, - stdlib_ndarray_every_by_s_x_as_f_x_1d, - stdlib_ndarray_every_by_s_x_as_f_x_2d, - stdlib_ndarray_every_by_s_x_as_f_x_3d, - stdlib_ndarray_every_by_s_x_as_f_x_4d, - stdlib_ndarray_every_by_s_x_as_f_x_5d, - stdlib_ndarray_every_by_s_x_as_f_x_6d, - stdlib_ndarray_every_by_s_x_as_f_x_7d, - stdlib_ndarray_every_by_s_x_as_f_x_8d, - stdlib_ndarray_every_by_s_x_as_f_x_9d, - stdlib_ndarray_every_by_s_x_as_f_x_10d, - stdlib_ndarray_every_by_s_x_as_f_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_s_x_as_f_x_2d_blocked, - stdlib_ndarray_every_by_s_x_as_f_x_3d_blocked, - stdlib_ndarray_every_by_s_x_as_f_x_4d_blocked, - stdlib_ndarray_every_by_s_x_as_f_x_5d_blocked, - stdlib_ndarray_every_by_s_x_as_f_x_6d_blocked, - stdlib_ndarray_every_by_s_x_as_f_x_7d_blocked, - stdlib_ndarray_every_by_s_x_as_f_x_8d_blocked, - stdlib_ndarray_every_by_s_x_as_f_x_9d_blocked, - stdlib_ndarray_every_by_s_x_as_f_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_f_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_f_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/s_x_as_i_x.c b/src/predicate/s_x_as_i_x.c deleted file mode 100644 index abcf914..0000000 --- a/src/predicate/s_x_as_i_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_0d( struct ndarray *arrays[], void *fcn ) { - int8_t v; - int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (int32_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( int8_t, int32_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_s_x_as_i_x_0d, - stdlib_ndarray_every_by_s_x_as_i_x_1d, - stdlib_ndarray_every_by_s_x_as_i_x_2d, - stdlib_ndarray_every_by_s_x_as_i_x_3d, - stdlib_ndarray_every_by_s_x_as_i_x_4d, - stdlib_ndarray_every_by_s_x_as_i_x_5d, - stdlib_ndarray_every_by_s_x_as_i_x_6d, - stdlib_ndarray_every_by_s_x_as_i_x_7d, - stdlib_ndarray_every_by_s_x_as_i_x_8d, - stdlib_ndarray_every_by_s_x_as_i_x_9d, - stdlib_ndarray_every_by_s_x_as_i_x_10d, - stdlib_ndarray_every_by_s_x_as_i_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_s_x_as_i_x_2d_blocked, - stdlib_ndarray_every_by_s_x_as_i_x_3d_blocked, - stdlib_ndarray_every_by_s_x_as_i_x_4d_blocked, - stdlib_ndarray_every_by_s_x_as_i_x_5d_blocked, - stdlib_ndarray_every_by_s_x_as_i_x_6d_blocked, - stdlib_ndarray_every_by_s_x_as_i_x_7d_blocked, - stdlib_ndarray_every_by_s_x_as_i_x_8d_blocked, - stdlib_ndarray_every_by_s_x_as_i_x_9d_blocked, - stdlib_ndarray_every_by_s_x_as_i_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_i_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_i_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/s_x_as_k_x.c b/src/predicate/s_x_as_k_x.c deleted file mode 100644 index 84cc419..0000000 --- a/src/predicate/s_x_as_k_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_0d( struct ndarray *arrays[], void *fcn ) { - int8_t v; - int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (int16_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( int8_t, int16_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_s_x_as_k_x_0d, - stdlib_ndarray_every_by_s_x_as_k_x_1d, - stdlib_ndarray_every_by_s_x_as_k_x_2d, - stdlib_ndarray_every_by_s_x_as_k_x_3d, - stdlib_ndarray_every_by_s_x_as_k_x_4d, - stdlib_ndarray_every_by_s_x_as_k_x_5d, - stdlib_ndarray_every_by_s_x_as_k_x_6d, - stdlib_ndarray_every_by_s_x_as_k_x_7d, - stdlib_ndarray_every_by_s_x_as_k_x_8d, - stdlib_ndarray_every_by_s_x_as_k_x_9d, - stdlib_ndarray_every_by_s_x_as_k_x_10d, - stdlib_ndarray_every_by_s_x_as_k_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_s_x_as_k_x_2d_blocked, - stdlib_ndarray_every_by_s_x_as_k_x_3d_blocked, - stdlib_ndarray_every_by_s_x_as_k_x_4d_blocked, - stdlib_ndarray_every_by_s_x_as_k_x_5d_blocked, - stdlib_ndarray_every_by_s_x_as_k_x_6d_blocked, - stdlib_ndarray_every_by_s_x_as_k_x_7d_blocked, - stdlib_ndarray_every_by_s_x_as_k_x_8d_blocked, - stdlib_ndarray_every_by_s_x_as_k_x_9d_blocked, - stdlib_ndarray_every_by_s_x_as_k_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_k_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_k_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_k_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/s_x_as_z_x.c b/src/predicate/s_x_as_z_x.c deleted file mode 100644 index 6b8f1de..0000000 --- a/src/predicate/s_x_as_z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - int8_t v; - int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_int8( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( int8_t, stdlib_complex128_from_int8 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_s_x_as_z_x_0d, - stdlib_ndarray_every_by_s_x_as_z_x_1d, - stdlib_ndarray_every_by_s_x_as_z_x_2d, - stdlib_ndarray_every_by_s_x_as_z_x_3d, - stdlib_ndarray_every_by_s_x_as_z_x_4d, - stdlib_ndarray_every_by_s_x_as_z_x_5d, - stdlib_ndarray_every_by_s_x_as_z_x_6d, - stdlib_ndarray_every_by_s_x_as_z_x_7d, - stdlib_ndarray_every_by_s_x_as_z_x_8d, - stdlib_ndarray_every_by_s_x_as_z_x_9d, - stdlib_ndarray_every_by_s_x_as_z_x_10d, - stdlib_ndarray_every_by_s_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_s_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_s_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_s_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_s_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_s_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_s_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_s_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_s_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_s_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/s_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_s_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_s_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/t_x.c b/src/predicate/t_x.c deleted file mode 100644 index 7799738..0000000 --- a/src/predicate/t_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/t_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_0d( struct ndarray *arrays[], void *fcn ) { - uint16_t v; - int8_t status = stdlib_ndarray_iget_uint16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( uint16_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint16_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( uint16_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_t_x_0d, - stdlib_ndarray_every_by_t_x_1d, - stdlib_ndarray_every_by_t_x_2d, - stdlib_ndarray_every_by_t_x_3d, - stdlib_ndarray_every_by_t_x_4d, - stdlib_ndarray_every_by_t_x_5d, - stdlib_ndarray_every_by_t_x_6d, - stdlib_ndarray_every_by_t_x_7d, - stdlib_ndarray_every_by_t_x_8d, - stdlib_ndarray_every_by_t_x_9d, - stdlib_ndarray_every_by_t_x_10d, - stdlib_ndarray_every_by_t_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_t_x_2d_blocked, - stdlib_ndarray_every_by_t_x_3d_blocked, - stdlib_ndarray_every_by_t_x_4d_blocked, - stdlib_ndarray_every_by_t_x_5d_blocked, - stdlib_ndarray_every_by_t_x_6d_blocked, - stdlib_ndarray_every_by_t_x_7d_blocked, - stdlib_ndarray_every_by_t_x_8d_blocked, - stdlib_ndarray_every_by_t_x_9d_blocked, - stdlib_ndarray_every_by_t_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint16_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/t_x_as_c_x.c b/src/predicate/t_x_as_c_x.c deleted file mode 100644 index 032f412..0000000 --- a/src/predicate/t_x_as_c_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float32/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_0d( struct ndarray *arrays[], void *fcn ) { - uint16_t v; - int8_t status = stdlib_ndarray_iget_uint16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex64_from_uint16( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex64_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex64_from_uint16 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_t_x_as_c_x_0d, - stdlib_ndarray_every_by_t_x_as_c_x_1d, - stdlib_ndarray_every_by_t_x_as_c_x_2d, - stdlib_ndarray_every_by_t_x_as_c_x_3d, - stdlib_ndarray_every_by_t_x_as_c_x_4d, - stdlib_ndarray_every_by_t_x_as_c_x_5d, - stdlib_ndarray_every_by_t_x_as_c_x_6d, - stdlib_ndarray_every_by_t_x_as_c_x_7d, - stdlib_ndarray_every_by_t_x_as_c_x_8d, - stdlib_ndarray_every_by_t_x_as_c_x_9d, - stdlib_ndarray_every_by_t_x_as_c_x_10d, - stdlib_ndarray_every_by_t_x_as_c_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_t_x_as_c_x_2d_blocked, - stdlib_ndarray_every_by_t_x_as_c_x_3d_blocked, - stdlib_ndarray_every_by_t_x_as_c_x_4d_blocked, - stdlib_ndarray_every_by_t_x_as_c_x_5d_blocked, - stdlib_ndarray_every_by_t_x_as_c_x_6d_blocked, - stdlib_ndarray_every_by_t_x_as_c_x_7d_blocked, - stdlib_ndarray_every_by_t_x_as_c_x_8d_blocked, - stdlib_ndarray_every_by_t_x_as_c_x_9d_blocked, - stdlib_ndarray_every_by_t_x_as_c_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_c_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float32/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex64_t x ) { -* return ( stdlib_complex64_real( x ) == 0.0f && stdlib_complex64_imag( x ) == 0.0f ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_c_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_c_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/t_x_as_d_x.c b/src/predicate/t_x_as_d_x.c deleted file mode 100644 index 27a6af9..0000000 --- a/src/predicate/t_x_as_d_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ) { - uint16_t v; - int8_t status = stdlib_ndarray_iget_uint16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (double)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint16_t, double ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_t_x_as_d_x_0d, - stdlib_ndarray_every_by_t_x_as_d_x_1d, - stdlib_ndarray_every_by_t_x_as_d_x_2d, - stdlib_ndarray_every_by_t_x_as_d_x_3d, - stdlib_ndarray_every_by_t_x_as_d_x_4d, - stdlib_ndarray_every_by_t_x_as_d_x_5d, - stdlib_ndarray_every_by_t_x_as_d_x_6d, - stdlib_ndarray_every_by_t_x_as_d_x_7d, - stdlib_ndarray_every_by_t_x_as_d_x_8d, - stdlib_ndarray_every_by_t_x_as_d_x_9d, - stdlib_ndarray_every_by_t_x_as_d_x_10d, - stdlib_ndarray_every_by_t_x_as_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_t_x_as_d_x_2d_blocked, - stdlib_ndarray_every_by_t_x_as_d_x_3d_blocked, - stdlib_ndarray_every_by_t_x_as_d_x_4d_blocked, - stdlib_ndarray_every_by_t_x_as_d_x_5d_blocked, - stdlib_ndarray_every_by_t_x_as_d_x_6d_blocked, - stdlib_ndarray_every_by_t_x_as_d_x_7d_blocked, - stdlib_ndarray_every_by_t_x_as_d_x_8d_blocked, - stdlib_ndarray_every_by_t_x_as_d_x_9d_blocked, - stdlib_ndarray_every_by_t_x_as_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_d_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_d_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/t_x_as_f_x.c b/src/predicate/t_x_as_f_x.c deleted file mode 100644 index 9262602..0000000 --- a/src/predicate/t_x_as_f_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_0d( struct ndarray *arrays[], void *fcn ) { - uint16_t v; - int8_t status = stdlib_ndarray_iget_uint16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (float)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const float x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint16_t, float ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_t_x_as_f_x_0d, - stdlib_ndarray_every_by_t_x_as_f_x_1d, - stdlib_ndarray_every_by_t_x_as_f_x_2d, - stdlib_ndarray_every_by_t_x_as_f_x_3d, - stdlib_ndarray_every_by_t_x_as_f_x_4d, - stdlib_ndarray_every_by_t_x_as_f_x_5d, - stdlib_ndarray_every_by_t_x_as_f_x_6d, - stdlib_ndarray_every_by_t_x_as_f_x_7d, - stdlib_ndarray_every_by_t_x_as_f_x_8d, - stdlib_ndarray_every_by_t_x_as_f_x_9d, - stdlib_ndarray_every_by_t_x_as_f_x_10d, - stdlib_ndarray_every_by_t_x_as_f_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_t_x_as_f_x_2d_blocked, - stdlib_ndarray_every_by_t_x_as_f_x_3d_blocked, - stdlib_ndarray_every_by_t_x_as_f_x_4d_blocked, - stdlib_ndarray_every_by_t_x_as_f_x_5d_blocked, - stdlib_ndarray_every_by_t_x_as_f_x_6d_blocked, - stdlib_ndarray_every_by_t_x_as_f_x_7d_blocked, - stdlib_ndarray_every_by_t_x_as_f_x_8d_blocked, - stdlib_ndarray_every_by_t_x_as_f_x_9d_blocked, - stdlib_ndarray_every_by_t_x_as_f_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_f_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const float x ) { -* return x == 0.0f; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_f_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_f_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/t_x_as_i_x.c b/src/predicate/t_x_as_i_x.c deleted file mode 100644 index 37d9363..0000000 --- a/src/predicate/t_x_as_i_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_0d( struct ndarray *arrays[], void *fcn ) { - uint16_t v; - int8_t status = stdlib_ndarray_iget_uint16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (int32_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const int32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint16_t, int32_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_t_x_as_i_x_0d, - stdlib_ndarray_every_by_t_x_as_i_x_1d, - stdlib_ndarray_every_by_t_x_as_i_x_2d, - stdlib_ndarray_every_by_t_x_as_i_x_3d, - stdlib_ndarray_every_by_t_x_as_i_x_4d, - stdlib_ndarray_every_by_t_x_as_i_x_5d, - stdlib_ndarray_every_by_t_x_as_i_x_6d, - stdlib_ndarray_every_by_t_x_as_i_x_7d, - stdlib_ndarray_every_by_t_x_as_i_x_8d, - stdlib_ndarray_every_by_t_x_as_i_x_9d, - stdlib_ndarray_every_by_t_x_as_i_x_10d, - stdlib_ndarray_every_by_t_x_as_i_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_t_x_as_i_x_2d_blocked, - stdlib_ndarray_every_by_t_x_as_i_x_3d_blocked, - stdlib_ndarray_every_by_t_x_as_i_x_4d_blocked, - stdlib_ndarray_every_by_t_x_as_i_x_5d_blocked, - stdlib_ndarray_every_by_t_x_as_i_x_6d_blocked, - stdlib_ndarray_every_by_t_x_as_i_x_7d_blocked, - stdlib_ndarray_every_by_t_x_as_i_x_8d_blocked, - stdlib_ndarray_every_by_t_x_as_i_x_9d_blocked, - stdlib_ndarray_every_by_t_x_as_i_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_i_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const int32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_i_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_i_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/t_x_as_u_x.c b/src/predicate/t_x_as_u_x.c deleted file mode 100644 index 4583231..0000000 --- a/src/predicate/t_x_as_u_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_0d( struct ndarray *arrays[], void *fcn ) { - uint16_t v; - int8_t status = stdlib_ndarray_iget_uint16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (uint32_t)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint16_t, uint32_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_t_x_as_u_x_0d, - stdlib_ndarray_every_by_t_x_as_u_x_1d, - stdlib_ndarray_every_by_t_x_as_u_x_2d, - stdlib_ndarray_every_by_t_x_as_u_x_3d, - stdlib_ndarray_every_by_t_x_as_u_x_4d, - stdlib_ndarray_every_by_t_x_as_u_x_5d, - stdlib_ndarray_every_by_t_x_as_u_x_6d, - stdlib_ndarray_every_by_t_x_as_u_x_7d, - stdlib_ndarray_every_by_t_x_as_u_x_8d, - stdlib_ndarray_every_by_t_x_as_u_x_9d, - stdlib_ndarray_every_by_t_x_as_u_x_10d, - stdlib_ndarray_every_by_t_x_as_u_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_t_x_as_u_x_2d_blocked, - stdlib_ndarray_every_by_t_x_as_u_x_3d_blocked, - stdlib_ndarray_every_by_t_x_as_u_x_4d_blocked, - stdlib_ndarray_every_by_t_x_as_u_x_5d_blocked, - stdlib_ndarray_every_by_t_x_as_u_x_6d_blocked, - stdlib_ndarray_every_by_t_x_as_u_x_7d_blocked, - stdlib_ndarray_every_by_t_x_as_u_x_8d_blocked, - stdlib_ndarray_every_by_t_x_as_u_x_9d_blocked, - stdlib_ndarray_every_by_t_x_as_u_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_u_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_u_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/t_x_as_z_x.c b/src/predicate/t_x_as_z_x.c deleted file mode 100644 index 4428452..0000000 --- a/src/predicate/t_x_as_z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - uint16_t v; - int8_t status = stdlib_ndarray_iget_uint16( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_uint16( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( uint16_t, stdlib_complex128_from_uint16 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_t_x_as_z_x_0d, - stdlib_ndarray_every_by_t_x_as_z_x_1d, - stdlib_ndarray_every_by_t_x_as_z_x_2d, - stdlib_ndarray_every_by_t_x_as_z_x_3d, - stdlib_ndarray_every_by_t_x_as_z_x_4d, - stdlib_ndarray_every_by_t_x_as_z_x_5d, - stdlib_ndarray_every_by_t_x_as_z_x_6d, - stdlib_ndarray_every_by_t_x_as_z_x_7d, - stdlib_ndarray_every_by_t_x_as_z_x_8d, - stdlib_ndarray_every_by_t_x_as_z_x_9d, - stdlib_ndarray_every_by_t_x_as_z_x_10d, - stdlib_ndarray_every_by_t_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_t_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_t_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_t_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_t_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_t_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_t_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_t_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_t_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_t_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/t_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT16; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_t_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_t_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/u_x.c b/src/predicate/u_x.c deleted file mode 100644 index 1c82799..0000000 --- a/src/predicate/u_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/u_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_0d( struct ndarray *arrays[], void *fcn ) { - uint32_t v; - int8_t status = stdlib_ndarray_iget_uint32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( uint32_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const uint32_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( uint32_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_u_x_0d, - stdlib_ndarray_every_by_u_x_1d, - stdlib_ndarray_every_by_u_x_2d, - stdlib_ndarray_every_by_u_x_3d, - stdlib_ndarray_every_by_u_x_4d, - stdlib_ndarray_every_by_u_x_5d, - stdlib_ndarray_every_by_u_x_6d, - stdlib_ndarray_every_by_u_x_7d, - stdlib_ndarray_every_by_u_x_8d, - stdlib_ndarray_every_by_u_x_9d, - stdlib_ndarray_every_by_u_x_10d, - stdlib_ndarray_every_by_u_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_u_x_2d_blocked, - stdlib_ndarray_every_by_u_x_3d_blocked, - stdlib_ndarray_every_by_u_x_4d_blocked, - stdlib_ndarray_every_by_u_x_5d_blocked, - stdlib_ndarray_every_by_u_x_6d_blocked, - stdlib_ndarray_every_by_u_x_7d_blocked, - stdlib_ndarray_every_by_u_x_8d_blocked, - stdlib_ndarray_every_by_u_x_9d_blocked, - stdlib_ndarray_every_by_u_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const uint32_t x ) { -* return x == 0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/u_x_as_d_x.c b/src/predicate/u_x_as_d_x.c deleted file mode 100644 index 671da9a..0000000 --- a/src/predicate/u_x_as_d_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_0d( struct ndarray *arrays[], void *fcn ) { - uint32_t v; - int8_t status = stdlib_ndarray_iget_uint32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( (double)v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const double x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST( uint32_t, double ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_u_x_as_d_x_0d, - stdlib_ndarray_every_by_u_x_as_d_x_1d, - stdlib_ndarray_every_by_u_x_as_d_x_2d, - stdlib_ndarray_every_by_u_x_as_d_x_3d, - stdlib_ndarray_every_by_u_x_as_d_x_4d, - stdlib_ndarray_every_by_u_x_as_d_x_5d, - stdlib_ndarray_every_by_u_x_as_d_x_6d, - stdlib_ndarray_every_by_u_x_as_d_x_7d, - stdlib_ndarray_every_by_u_x_as_d_x_8d, - stdlib_ndarray_every_by_u_x_as_d_x_9d, - stdlib_ndarray_every_by_u_x_as_d_x_10d, - stdlib_ndarray_every_by_u_x_as_d_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_u_x_as_d_x_2d_blocked, - stdlib_ndarray_every_by_u_x_as_d_x_3d_blocked, - stdlib_ndarray_every_by_u_x_as_d_x_4d_blocked, - stdlib_ndarray_every_by_u_x_as_d_x_5d_blocked, - stdlib_ndarray_every_by_u_x_as_d_x_6d_blocked, - stdlib_ndarray_every_by_u_x_as_d_x_7d_blocked, - stdlib_ndarray_every_by_u_x_as_d_x_8d_blocked, - stdlib_ndarray_every_by_u_x_as_d_x_9d_blocked, - stdlib_ndarray_every_by_u_x_as_d_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_d_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const double x ) { -* return x == 0.0; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_d_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_d_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/u_x_as_z_x.c b/src/predicate/u_x_as_z_x.c deleted file mode 100644 index f7bd622..0000000 --- a/src/predicate/u_x_as_z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_0d( struct ndarray *arrays[], void *fcn ) { - uint32_t v; - int8_t status = stdlib_ndarray_iget_uint32( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( stdlib_complex128_from_uint32( v ) ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 32, 32, 32, 32, 32, 32, 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16, 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK_ARG_CAST_FCN( uint32_t, stdlib_complex128_from_uint32 ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_u_x_as_z_x_0d, - stdlib_ndarray_every_by_u_x_as_z_x_1d, - stdlib_ndarray_every_by_u_x_as_z_x_2d, - stdlib_ndarray_every_by_u_x_as_z_x_3d, - stdlib_ndarray_every_by_u_x_as_z_x_4d, - stdlib_ndarray_every_by_u_x_as_z_x_5d, - stdlib_ndarray_every_by_u_x_as_z_x_6d, - stdlib_ndarray_every_by_u_x_as_z_x_7d, - stdlib_ndarray_every_by_u_x_as_z_x_8d, - stdlib_ndarray_every_by_u_x_as_z_x_9d, - stdlib_ndarray_every_by_u_x_as_z_x_10d, - stdlib_ndarray_every_by_u_x_as_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_u_x_as_z_x_2d_blocked, - stdlib_ndarray_every_by_u_x_as_z_x_3d_blocked, - stdlib_ndarray_every_by_u_x_as_z_x_4d_blocked, - stdlib_ndarray_every_by_u_x_as_z_x_5d_blocked, - stdlib_ndarray_every_by_u_x_as_z_x_6d_blocked, - stdlib_ndarray_every_by_u_x_as_z_x_7d_blocked, - stdlib_ndarray_every_by_u_x_as_z_x_8d_blocked, - stdlib_ndarray_every_by_u_x_as_z_x_9d_blocked, - stdlib_ndarray_every_by_u_x_as_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/u_x_as_z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_UINT32; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_u_x_as_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_u_x_as_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/x_x.c b/src/predicate/x_x.c deleted file mode 100644 index 20911bc..0000000 --- a/src/predicate/x_x.c +++ /dev/null @@ -1,2213 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/x_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_0d( struct ndarray *arrays[], void *fcn ) { - bool v; - int8_t status = stdlib_ndarray_iget_bool( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( bool ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 4, 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const bool x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( bool ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_x_x_0d, - stdlib_ndarray_every_by_x_x_1d, - stdlib_ndarray_every_by_x_x_2d, - stdlib_ndarray_every_by_x_x_3d, - stdlib_ndarray_every_by_x_x_4d, - stdlib_ndarray_every_by_x_x_5d, - stdlib_ndarray_every_by_x_x_6d, - stdlib_ndarray_every_by_x_x_7d, - stdlib_ndarray_every_by_x_x_8d, - stdlib_ndarray_every_by_x_x_9d, - stdlib_ndarray_every_by_x_x_10d, - stdlib_ndarray_every_by_x_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_x_x_2d_blocked, - stdlib_ndarray_every_by_x_x_3d_blocked, - stdlib_ndarray_every_by_x_x_4d_blocked, - stdlib_ndarray_every_by_x_x_5d_blocked, - stdlib_ndarray_every_by_x_x_6d_blocked, - stdlib_ndarray_every_by_x_x_7d_blocked, - stdlib_ndarray_every_by_x_x_8d_blocked, - stdlib_ndarray_every_by_x_x_9d_blocked, - stdlib_ndarray_every_by_x_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/x_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 2, 1 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const bool x ) { -* return x; -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_x_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_x_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/src/predicate/z_x.c b/src/predicate/z_x.c deleted file mode 100644 index 03d999e..0000000 --- a/src/predicate/z_x.c +++ /dev/null @@ -1,2236 +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. -*/ - -/* -* The following is auto-generated. Do not manually edit. See scripts/predicate_loops.js. -*/ - -#include "stdlib/ndarray/base/every/predicate/z_x.h" -#include "stdlib/ndarray/base/every/typedefs.h" -#include "stdlib/ndarray/base/every/macros.h" -#include "stdlib/ndarray/base/every/dispatch_object.h" -#include "stdlib/ndarray/base/every/dispatch.h" -#include "stdlib/ndarray/ctor.h" -#include "stdlib/complex/float64/ctor.h" -#include -#include - -/** -* Tests whether every element in a zero-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 0; -* -* // Define the array shapes: -* int64_t *shx = NULL; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 0 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_0d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_0d( struct ndarray *arrays[], void *fcn ) { - stdlib_complex128_t v; - int8_t status = stdlib_ndarray_iget_complex128( arrays[ 0 ], 0, &v ); - if ( status != 0 ) { - return -1; - } - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - status = stdlib_ndarray_iset_bool( arrays[ 1 ], 0, f( v ) ); - if ( status != 0 ) { - return -1; - } - return 0; -} - -/** -* Tests whether every element in a one-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 1; -* -* // Define the array shapes: -* int64_t shx[] = { 3 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_1d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_1d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_1D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_2d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_2d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a two-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_2d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_2D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_3d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_3d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a three-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_3d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_3D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_4d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_4d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a four-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 4; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_4d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_4D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_5d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_5d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a five-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 5; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_5d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_5D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_6d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_6d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a six-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 6; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_6d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_6D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_7d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_7d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a seven-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 7; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_7d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_7D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_8d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_8d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in an eight-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 8; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_8d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_8D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_9d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_9d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a nine-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 9; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_9d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_9D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_10d( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_10d( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in a ten-dimensional input ndarray is truthy according to a predicate function and assigns results to elements in a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 10; -* -* // Define the array shapes: -* int64_t shx[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 128, 128, 128, 128, 128, 128, 128, 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_10d_blocked( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_10D_BLOCKED_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -/** -* Tests whether every element in an n-dimensional input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 3; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 64, 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x_nd( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x_nd( struct ndarray *arrays[], void *fcn ) { - typedef bool func_type( const stdlib_complex128_t x ); - func_type *f = (func_type *)fcn; - STDLIB_NDARRAY_EVERY_ND_LOOP_CLBK( stdlib_complex128_t ) - return 0; -} - -// Define a list of ndarray functions: -static ndarrayEveryFcn functions[] = { - stdlib_ndarray_every_by_z_x_0d, - stdlib_ndarray_every_by_z_x_1d, - stdlib_ndarray_every_by_z_x_2d, - stdlib_ndarray_every_by_z_x_3d, - stdlib_ndarray_every_by_z_x_4d, - stdlib_ndarray_every_by_z_x_5d, - stdlib_ndarray_every_by_z_x_6d, - stdlib_ndarray_every_by_z_x_7d, - stdlib_ndarray_every_by_z_x_8d, - stdlib_ndarray_every_by_z_x_9d, - stdlib_ndarray_every_by_z_x_10d, - stdlib_ndarray_every_by_z_x_nd -}; - -// Define a list of ndarray functions implementing loop blocking... -static ndarrayEveryFcn blocked_functions[] = { - stdlib_ndarray_every_by_z_x_2d_blocked, - stdlib_ndarray_every_by_z_x_3d_blocked, - stdlib_ndarray_every_by_z_x_4d_blocked, - stdlib_ndarray_every_by_z_x_5d_blocked, - stdlib_ndarray_every_by_z_x_6d_blocked, - stdlib_ndarray_every_by_z_x_7d_blocked, - stdlib_ndarray_every_by_z_x_8d_blocked, - stdlib_ndarray_every_by_z_x_9d_blocked, - stdlib_ndarray_every_by_z_x_10d_blocked -}; - -// Create a function dispatch object: -static const struct ndarrayEveryDispatchObject obj = { - // Array containing ndarray functions: - functions, - - // Number of ndarray functions: - 12, - - // Array containing ndarray functions using loop blocking: - blocked_functions, - - // Number of ndarray functions using loop blocking: - 9 -}; - -/** -* Tests whether every element in an input ndarray is truthy according to a predicate function and assigns results to elements a zero-dimensional output ndarray. -* -* ## Notes -* -* - If successful, the functions returns `0`; otherwise, the function returns an error code. -* -* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray -* @param fcn callback -* @return status code -* -* @example -* #include "stdlib/ndarray/base/every/predicate/z_x.h" -* #include "stdlib/ndarray/dtypes.h" -* #include "stdlib/ndarray/index_modes.h" -* #include "stdlib/ndarray/orders.h" -* #include "stdlib/ndarray/ctor.h" -* #include "stdlib/complex/float64/ctor.h" -* #include -* #include -* #include -* #include -* -* // Define the ndarray data types: -* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_COMPLEX128; -* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL; -* -* // Create underlying byte arrays: -* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -* uint8_t ybuf[] = { 0 }; -* -* // Define the number of dimensions: -* int64_t ndims = 2; -* -* // Define the array shapes: -* int64_t shx[] = { 2, 2 }; -* int64_t *shy = NULL; -* -* // Define the strides: -* int64_t sx[] = { 32, 16 }; -* int64_t sy[] = { 0 }; -* -* // Define the offsets: -* int64_t ox = 0; -* int64_t oy = 0; -* -* // Define the array order: -* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; -* -* // Specify the index mode: -* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; -* -* // Specify the subscript index modes: -* int8_t submodes[] = { imode }; -* int64_t nsubmodes = 1; -* -* // Create an input ndarray: -* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shx, sx, ox, order, imode, nsubmodes, submodes ); -* if ( x == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an output ndarray: -* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, 0, shy, sy, oy, order, imode, nsubmodes, submodes ); -* if ( y == NULL ) { -* fprintf( stderr, "Error allocating memory.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // Create an array containing the ndarrays: -* struct ndarray *arrays[] = { x, y }; -* -* // Define a callback: -* static bool fcn( const stdlib_complex128_t x ) { -* return ( stdlib_complex128_real( x ) == 0.0 && stdlib_complex128_imag( x ) == 0.0 ); -* } -* -* // Test elements: -* int8_t status = stdlib_ndarray_every_by_z_x( arrays, (void *)fcn ); -* if ( status != 0 ) { -* fprintf( stderr, "Error during computation.\n" ); -* exit( EXIT_FAILURE ); -* } -* -* // ... -* -* // Free allocated memory: -* stdlib_ndarray_free( x ); -* stdlib_ndarray_free( y ); -*/ -int8_t stdlib_ndarray_every_by_z_x( struct ndarray *arrays[], void *fcn ) { - return stdlib_ndarray_every_dispatch( &obj, arrays, fcn ); -} diff --git a/stats_browser.html b/stats_browser.html new file mode 100644 index 0000000..2ef15ea --- /dev/null +++ b/stats_browser.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/stats_node.html b/stats_node.html new file mode 100644 index 0000000..f9a4433 --- /dev/null +++ b/stats_node.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.0d.js b/test/test.0d.js deleted file mode 100644 index 02a5144..0000000 --- a/test/test.0d.js +++ /dev/null @@ -1,97 +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 tape = require( 'tape' ); -var Float64Array = require( '@stdlib/array-float64' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var Complex128 = require( '@stdlib/complex-float64-ctor' ); -var scalar2ndarray = require( '@stdlib/ndarray-from-scalar' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 0-dimensional ndarray is truthy', function test( t ) { - var actual; - var x; - - x = scalar2ndarray( 0.0, { - 'dtype': 'float64' - }); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = scalar2ndarray( 1.0, { - 'dtype': 'float64' - }); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 0-dimensional ndarray is truthy (accessors)', function test( t ) { - var actual; - var x; - - x = ndarray( 'float64', toAccessorArray( new Float64Array( [ 0.0 ] ) ), [], [ 0 ], 0, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( 'float64', toAccessorArray( new Float64Array( [ 1.0 ] ) ), [], [ 0 ], 0, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 0-dimensional ndarray is truthy (complex)', function test( t ) { - var actual; - var x; - - x = scalar2ndarray( new Complex128( 0.0, 0.0 ), { - 'dtype': 'complex128' - }); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = scalar2ndarray( new Complex128( 1.0, 0.0 ), { - 'dtype': 'complex128' - }); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.10d.js b/test/test.10d.js deleted file mode 100644 index 351500f..0000000 --- a/test/test.10d.js +++ /dev/null @@ -1,2949 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, -8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ 32, 16, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, 32, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*32, 16, -8, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*64, bsize*32, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*16, 8, 4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*32, bsize*16, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*16, - -8, - 4, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ - bsize*32, - bsize*32, - bsize*16, - -bsize*16, - bsize*8, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, -16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ 32, 16, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, 32, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*32, 16, -8, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*64, bsize*32, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*16, 8, 4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*32, bsize*16, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*16, - -8, - 4, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ - bsize*32, - bsize*32, - bsize*16, - -bsize*16, - bsize*8, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, -16, 16, -8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ 32, 16, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, 32, 16, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*32, 16, -8, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, bsize*64, bsize*32, -16, 8, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*16, 8, 4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*32, bsize*32, bsize*32, -bsize*32, bsize*16, 8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*16, - -8, - 4, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ - bsize*64, - bsize*64, - bsize*32, - -bsize*32, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ - bsize*32, - bsize*32, - bsize*16, - -bsize*16, - bsize*8, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -1, -1, -1, -1, -1, -1, -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 2, -2, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - -bsize*8, - bsize*8, - bsize*16, - bsize*16, - -bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 2, bsize*2, 2, 1 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 32, bsize*64, bsize*128 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 16, 32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 16, -16, 16, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = [ -1, -1, -1, -1, -1, -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, -2, 2, -2, 2, 2, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - -bsize*8, - bsize*8, - bsize*16, - bsize*16, - -bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 2, bsize*2, 2, 1 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 32, bsize*64, bsize*128 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 16, 32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 16, -16, 16, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = [ -1, -1, -1, -1, -1, -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, -2, 2, -2, 2, 2, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 1, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - -bsize*8, - bsize*8, - bsize*16, - bsize*16, - -bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ - 2, - 4, - 4, - 8, - bsize*16, - bsize*32, - bsize*32, - bsize*64, - bsize*64, - bsize*64 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 2, bsize*2, 2, 1 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 32, bsize*64, bsize*128 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, 16, 16, 32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 10-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 1, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 16, -16, 16, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.1d.js b/test/test.1d.js deleted file mode 100644 index be97108..0000000 --- a/test/test.1d.js +++ /dev/null @@ -1,88 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 1-dimensional ndarray is truthy', function test( t ) { - var actual; - var x; - - x = ndarray( 'float64', zeros( 8, 'float64' ), [ 4 ], [ 2 ], 1, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( 'float64', ones( 8, 'float64' ), [ 4 ], [ 2 ], 1, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 1-dimensional ndarray is truthy (accessors)', function test( t ) { - var actual; - var x; - - x = ndarray( 'float64', toAccessorArray( zeros( 8, 'float64' ) ), [ 4 ], [ 2 ], 1, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( 'float64', toAccessorArray( ones( 8, 'float64' ) ), [ 4 ], [ 2 ], 1, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 1-dimensional ndarray is truthy (complex)', function test( t ) { - var actual; - var x; - - x = ndarray( 'complex128', zeros( 6, 'complex128' ), [ 4 ], [ 1 ], 1, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( 'complex128', ones( 6, 'complex128' ), [ 4 ], [ 1 ], 1, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.2d.js b/test/test.2d.js deleted file mode 100644 index 6656420..0000000 --- a/test/test.2d.js +++ /dev/null @@ -1,1197 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2 ]; - st = [ -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2 ]; - st = [ bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2 ]; - st = [ -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2 ]; - st = [ bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2 ]; - st = [ 4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2 ]; - st = [ -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2 ]; - st = [ bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 4, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 4, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -1, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ 2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2 ]; - st = [ 2, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2 ]; - st = [ -2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -1, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ 2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2 ]; - st = [ -2, bsize*2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2 ]; - st = [ 2, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -1, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ 2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2 ]; - st = [ -2, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2 ]; - st = [ -2, bsize*2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 2-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2 ]; - st = [ 2, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.3d.js b/test/test.3d.js deleted file mode 100644 index 8641664..0000000 --- a/test/test.3d.js +++ /dev/null @@ -1,1383 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2 ]; - st = [ -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ -8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, bsize*2 ]; - st = [ bsize*8, bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2, 2 ]; - st = [ -4, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ -4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2 ]; - st = [ -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ -8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, bsize*2 ]; - st = [ -bsize*8, -bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2, 2 ]; - st = [ -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2 ]; - st = [ -3, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2 ]; - st = [ -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ -8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, bsize*2 ]; - st = [ bsize*8, bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 4, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 4, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ -1, -2, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 2, 4, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2 ]; - st = [ 2, -bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ 2, -2, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2 ]; - st = [ 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2, 2 ]; - st = [ -1, -2, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 2, 4, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 1 ]; - st = [ 2, -bsize*4, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ 2, -2, bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2 ]; - st = [ 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 2 ]; - st = [ -1, -2, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 2, 4, 4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2 ]; - st = [ 1, -2, -3 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 1 ]; - st = [ 2, -bsize*4, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2 ]; - st = [ -2, -2, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 3-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2 ]; - st = [ 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.4d.js b/test/test.4d.js deleted file mode 100644 index f8d24ce..0000000 --- a/test/test.4d.js +++ /dev/null @@ -1,1569 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ -2, -2, -1, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, 4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, -4, -2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1 ]; - st = [ -4, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2, 1 ]; - st = [ -bsize*8, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, bsize*2, 1 ]; - st = [ bsize*8, bsize*4, -2, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, 1, bsize*2 ]; - st = [ bsize*8, bsize*4, -bsize*4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 2, 1, 2 ]; - st = [ -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, 4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, -4, -2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1 ]; - st = [ -4, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2, 1 ]; - st = [ -bsize*8, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, bsize*2, 1 ]; - st = [ -bsize*4, -bsize*4, -2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2 ]; - st = [ -bsize*4, -bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2, 1, 2 ]; - st = [ -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, 4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 4, -4, -2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1 ]; - st = [ -4, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 2, 1 ]; - st = [ -bsize*8, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1 ]; - st = [ bsize*4, bsize*4, -2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2 ]; - st = [ bsize*4, bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2 ]; - st = [ -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 2, 4, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 2, -4, -4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, 1, bsize*2 ]; - st = [ 2, 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, bsize*2, 1 ]; - st = [ 2, -2, -4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 1, 2 ]; - st = [ 2, 2, -bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 1, 2 ]; - st = [ 2, -bsize*4, bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2 ]; - st = [ -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 2, 4, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 2, 4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 8, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1 ]; - st = [ 2, -bsize*4, -bsize*4, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1 ]; - st = [ 1, 2, -bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1 ]; - st = [ 2, 4, -4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*4 ]; - st = [ 2, 4, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2 ]; - st = [ -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 2, 4, 4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1 ]; - st = [ 2, -4, -4, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 8, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, 1, bsize*2 ]; - st = [ 2, 2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, bsize*2, 1 ]; - st = [ 2, 2, -4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 1, bsize*2, 1, 2 ]; - st = [ 2, 2, -bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 4-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 1, 2 ]; - st = [ 2, -bsize*4, bsize*4, -bsize*4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.5d.js b/test/test.5d.js deleted file mode 100644 index 209e5aa..0000000 --- a/test/test.5d.js +++ /dev/null @@ -1,1755 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 2, 1, 2, 2 ]; - st = [ -8, -4, -4, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ 8, -8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 2 ]; - st = [ bsize*8, -4, 4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, bsize*8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 1 ]; - st = [ bsize*8, bsize*8, -bsize*4, -2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, -bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ -4, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, -4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ 8, -8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 2 ]; - st = [ -bsize*8, -4, 4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, bsize*8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, -bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ -4, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 8, 8, -4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ 8, -8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 2 ]; - st = [ -bsize*8, -4, 4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, bsize*8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, -bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2, 2 ]; - st = [ -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 2, -4, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ -2, bsize*4, -bsize*4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 2 ]; - st = [ -2, 4, -bsize*8, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ -2, 4, -4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2 ]; - st = [ -2, 4, -4, 4, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ -2, 4, -4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ -1, -2, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 2, 4, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ -2, bsize*4, -bsize*4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1 ]; - st = [ -2, 4, -bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ -2, 4, -4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2 ]; - st = [ -2, -4, -4, 4, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ 2, 4, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ -1, -2, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2 ]; - st = [ 2, -4, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2 ]; - st = [ -2, bsize*4, -bsize*4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1 ]; - st = [ -2, 4, -bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2 ]; - st = [ -2, 4, -4, bsize*8, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2 ]; - st = [ -2, -4, -4, 4, bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 5-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2 ]; - st = [ 2, 4, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.6d.js b/test/test.6d.js deleted file mode 100644 index af5585b..0000000 --- a/test/test.6d.js +++ /dev/null @@ -1,1941 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, -16, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2 ]; - st = [ 8, -8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ bsize*8, -4, -4, 4, 4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ bsize*8, bsize*8, -4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, bsize*8, -bsize*8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, bsize*2, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, -bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, -16, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2 ]; - st = [ 8, -8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ -bsize*8, -4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ bsize*8, bsize*8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, bsize*2, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, -bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, -bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 8, -4, -4, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2 ]; - st = [ 8, -8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ -bsize*8, -4, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ bsize*8, bsize*8, -4, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 1, bsize*2, 2 ]; - st = [ bsize*8, -bsize*8, -bsize*8, -bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ bsize*8, -bsize*8, -bsize*4, -bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -1, -1, -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 2, -2, 2, -4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, -bsize*4, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ 2, 4, bsize*8, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ 2, 4, 4, -4, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 1 ]; - st = [ 2, 4, 4, -4, 8, -bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ 2, 4, 4, -8, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -1, -1, -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ 2, 4, bsize*8, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ 2, 4, 4, -4, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 1 ]; - st = [ 2, 4, 4, -4, 8, -bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ 2, 4, 4, -8, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ -1, -1, -1, -2, -4, -4 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2 ]; - st = [ 2, 4, bsize*8, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, -bsize*8, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2 ]; - st = [ 2, 4, 4, -4, bsize*8, -bsize*8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 1 ]; - st = [ 2, 4, 4, -4, 8, -bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 6-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2 ]; - st = [ 2, 4, 4, -8, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.7d.js b/test/test.7d.js deleted file mode 100644 index 9af1aa8..0000000 --- a/test/test.7d.js +++ /dev/null @@ -1,2127 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, -16, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 16, -16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 2, 1, 1, 2 ]; - st = [ bsize*16, -8, 8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ bsize*16, -bsize*16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 1, 1, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2 ]; - st = [ bsize*16, -bsize*16, -bsize*8, bsize*8, bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*16, -bsize*16, -bsize*8, bsize*8, bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2, 1, 2 ]; - st = [ -8, -8, -4, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -16, 16, -16, -8, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 16, -16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ bsize*16, -8, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ bsize*16, bsize*16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 1, 1, 2 ]; - st = [ bsize*16, -bsize*16, -bsize*8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, 1, bsize*2, 2 ]; - st = [ bsize*16, -bsize*16, -bsize*16, -bsize*8, bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 2, 1, 2, 1, 2, 1, 2 ]; - st = [ -8, -8, -4, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -16, 16, -16, 8, -4, -2, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 16, -16, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ -bsize*16, -8, 8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ bsize*16, -bsize*16, -8, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 1, 1, 2 ]; - st = [ bsize*16, -bsize*16, bsize*8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ bsize*16, -bsize*16, -bsize*8, -bsize*8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, 1, bsize*2, 2 ]; - st = [ bsize*16, -bsize*16, bsize*16, bsize*8, -bsize*8, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ bsize*16, -bsize*16, bsize*8, bsize*8, -bsize*4, bsize*4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2, 1, 2 ]; - st = [ -1, -2, -2, -4, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, -2, 2, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 2, -bsize*4, bsize*4, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 2, 1, 2, 1 ]; - st = [ 2, -4, bsize*8, -bsize*8, bsize*16, -bsize*16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, -4, -4, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2, 1, 2 ]; - st = [ 2, -4, -4, 4, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ 2, -4, -4, 8, 8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2 ]; - st = [ 2, -4, -4, 8, 8, 8, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ 2, -4, -4, 8, 8, 16, 16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2, 1, 2 ]; - st = [ -1, -2, -2, -4, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, -2, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, -bsize*8, bsize*8, -bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, 4, -bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, -4, 4, -bsize*8, bsize*8, -bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2, 2 ]; - st = [ 2, -4, -4, 4, bsize*8, bsize*8, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ 2, -4, -4, 8, 8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2 ]; - st = [ 2, -4, -4, 8, 8, 8, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ 2, -4, -4, 8, 8, 16, 16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 1, 2, 1, 2, 1, 2 ]; - st = [ -1, -2, -2, -4, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, -4, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 2, 1, 2 ]; - st = [ 2, -bsize*4, -bsize*4, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, -4, -bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, -4, -4, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 1, 2, 2 ]; - st = [ 2, -4, -4, 4, bsize*8, bsize*8, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 1, 2 ]; - st = [ 2, -4, -4, 8, 8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2 ]; - st = [ 2, -4, -4, 8, 8, 8, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 7-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, bsize*2 ]; - st = [ 2, -4, -4, 8, 8, 16, 16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.8d.js b/test/test.8d.js deleted file mode 100644 index 1a58b91..0000000 --- a/test/test.8d.js +++ /dev/null @@ -1,2340 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, -16, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 2 ]; - st = [ 32, -16, 8, -8, -8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 2 ]; - st = [ -bsize*32, -16, 8, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 2, 1, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, 16, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*32, -16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*16, -bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2, 2 ]; - st = [ -bsize*32, -bsize*32, -bsize*16, -bsize*16, -bsize*16, 8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 2 ]; - st = [ -bsize*16, -bsize*16, -bsize*8, bsize*8, bsize*8, bsize*8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, 1, bsize*2 ]; - st = [ - -bsize*16, - -bsize*16, - -bsize*8, - bsize*8, - bsize*8, - bsize*4, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, -16, 16, -16, -8, -4, 2, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 2 ]; - st = [ 32, 16, 8, -8, -8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 2 ]; - st = [ -bsize*32, -16, 8, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 2, 1, 2, 1, 2 ]; - st = [ bsize*32, bsize*32, 16, 8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2, 2, 1, 2 ]; - st = [ bsize*32, -bsize*32, -bsize*32, -16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 2, 1, 2 ]; - st = [ bsize*32, -bsize*32, bsize*16, -bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2, 2 ]; - st = [ bsize*32, -bsize*32, -bsize*16, -bsize*16, bsize*16, 8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 2 ]; - st = [ -bsize*16, -bsize*16, bsize*8, -bsize*8, -bsize*8, bsize*8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, 1, bsize*2 ]; - st = [ - -bsize*16, - -bsize*16, - bsize*8, - -bsize*8, - -bsize*8, - bsize*4, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, -16, 16, -16, 8, -4, -2, -2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 2 ]; - st = [ 32, 16, 8, -8, -8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 2 ]; - st = [ -bsize*32, -16, 8, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, bsize*2, 2, 1, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, 16, -8, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, bsize*2, 2, 2, 1, 2 ]; - st = [ -bsize*32, bsize*32, -bsize*32, -16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, bsize*2, 2, 1, 2 ]; - st = [ -bsize*32, -bsize*32, -bsize*16, -bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, bsize*2, 2, 2 ]; - st = [ -bsize*32, -bsize*32, bsize*16, bsize*16, -bsize*16, 8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, bsize*2, 2 ]; - st = [ -bsize*16, -bsize*16, bsize*8, bsize*8, -bsize*8, bsize*8, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, 1, bsize*2 ]; - st = [ - -bsize*16, - -bsize*16, - bsize*8, - bsize*8, - -bsize*8, - bsize*4, - -bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = [ -1, -1, -1, -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, -2, 2, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2, 1, 2 ]; - st = [ 2, -bsize*4, bsize*4, bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2, 1, 2 ]; - st = [ 2, -4, bsize*8, -bsize*8, bsize*8, bsize*8, -bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, 4, 8, bsize*16, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 2, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, 16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 1, 2 ]; - st = [ 2, -4, -4, 8, 8, 16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = [ -1, -1, -1, -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -2, 2, -2, 2, 2, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2, 1, 2 ]; - st = [ 2, bsize*4, bsize*4, -bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2, 1, 2 ]; - st = [ 2, -4, -bsize*8, bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, 4, 8, -bsize*16, bsize*16, -bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 2, bsize*2, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, 16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = [ -1, -1, -1, -1, -2, -4, -4, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 1, 2, 1, 1, 2, 1, 2 ]; - st = [ 2, -bsize*4, -bsize*4, bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 1, 1, 1, 2, 1, 2 ]; - st = [ 2, -4, bsize*8, bsize*8, bsize*8, bsize*8, bsize*16, bsize*16 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 1, 1, 2, 1, 2 ]; - st = [ 2, -4, -8, bsize*16, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 1, 2, 1, 2 ]; - st = [ 2, -4, -4, 8, bsize*16, bsize*16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 2, bsize*2, 1, 1, 2 ]; - st = [ 2, -4, -4, 8, 16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 1, 2 ]; - st = [ 2, -4, -4, 8, 8, 16, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, -4, -4, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 8-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.9d.js b/test/test.9d.js deleted file mode 100644 index 445a92a..0000000 --- a/test/test.9d.js +++ /dev/null @@ -1,2649 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var blockSize = require( '@stdlib/ndarray-base-nullary-tiling-block-size' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, -16, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ 32, -16, 8, -8, -8, 4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ -bsize*32, -16, 8, -8, -8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 1, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ -bsize*64, -bsize*32, 16, -8, -8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, 16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ -bsize*64, -bsize*64, bsize*32, -bsize*16, -8, 4, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ -bsize*64, -bsize*64, -bsize*32, -bsize*32, -bsize*16, 8, -4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - -bsize*64, - -bsize*64, - -bsize*32, - bsize*32, - bsize*32, - bsize*16, - 8, - -4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, -16, 16, -8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ 32, -16, -8, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*32, -16, -8, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*32, -16, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, 16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, bsize*16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, bsize*32, bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - -bsize*64, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - -4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ -8, -8, -8, -8, -8, -4, -2, -2, -1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 8, 4, 4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, -16, 16, -8, -4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ 32, -16, -8, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ bsize*32, -16, -8, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*32, -16, 8, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, 16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, bsize*16, 8, -4, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ bsize*64, -bsize*64, -bsize*32, bsize*32, bsize*16, -8, 4, -4, 2 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ - bsize*64, - -bsize*64, - -bsize*32, - bsize*32, - bsize*32, - -bsize*16, - 8, - -4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*16, - -bsize*16, - bsize*8, - 4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (row-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, 1, 1, 2, bsize*2 ]; - st = [ - -bsize*32, - -bsize*32, - -bsize*16, - bsize*16, - bsize*8, - -bsize*8, - bsize*8, - bsize*4, - 2 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 4 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, contiguous, negative strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2, 1, 1, 1, 1, 1 ]; - st = [ -1, -2, -4, -4, -8, -8, -8, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, -2, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 1, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 1, 1, 2 ]; - st = [ 2, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32, bsize*32 ]; // eslint-disable-line max-len - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 2, 2, 1, 2, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, contiguous, negative strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2, 1, 1, 1, 1, 1 ]; - st = [ -1, -2, -4, -4, -8, -8, -8, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, -2, 2, -2, 2, 1, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 1, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 1, 1, 2 ]; - st = [ 2, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32, bsize*32 ]; // eslint-disable-line max-len - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, complex)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh )*2, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, contiguous, negative strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 2, 2, 1, 2, 1, 1, 1, 1, 1 ]; - st = [ -1, -2, -4, -4, -8, -8, -8, -8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, 2, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 2, 2, 2, 2, 2, -2, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ bsize*2, 2, 2, 1, 1, 2, 1, 1, 2 ]; - st = [ - 2, - bsize*4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*32, - bsize*32, - bsize*32 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, bsize*2, 2, 1, 1, 1, 1, 1, 2 ]; - st = [ - 2, - 4, - bsize*8, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16, - bsize*16 - ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 2, bsize*2, 2, 1, 1, 1, 1, 2 ]; - st = [ 2, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32, bsize*32 ]; // eslint-disable-line max-len - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, bsize*2, 2, 1, 1, 1, 2 ]; - st = [ 2, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 1, 2, bsize*2, 2, 1, 1, 2 ]; - st = [ 2, 4, 4, 4, 8, bsize*16, bsize*32, bsize*32, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 2, bsize*2, 2, 1, 2 ]; - st = [ 2, 4, 4, 8, 8, 16, bsize*32, bsize*64, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 2, bsize*2, 2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 16, bsize*32, bsize*64 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, bsize*2, 2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, bsize*32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a 9-dimensional ndarray is truthy (column-major, non-contiguous, large arrays, accessors)', function test( t ) { - var actual; - var bsize; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - - bsize = blockSize( dt ); - sh = [ 2, 1, 2, 1, 1, 1, 2, 2, bsize*2 ]; - st = [ 2, 4, 4, 8, 8, 8, 8, 16, 32 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh )*2, dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 01e3a8d..0000000 --- a/test/test.js +++ /dev/null @@ -1,47 +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 tape = require( 'tape' ); -var zeros = require( '@stdlib/array-zeros' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns `true` if the input is an empty ndarray', function test( t ) { - var actual; - var x; - - x = ndarray( 'float64', zeros( 8, 'float64' ), [ 0 ], [ 1 ], 0, 'row-major' ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.nd.js b/test/test.nd.js deleted file mode 100644 index f753189..0000000 --- a/test/test.nd.js +++ /dev/null @@ -1,656 +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 tape = require( 'tape' ); -var toAccessorArray = require( '@stdlib/array-base-to-accessor-array' ); -var zeros = require( '@stdlib/array-zeros' ); -var ones = require( '@stdlib/array-ones' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var shape2strides = require( '@stdlib/ndarray-base-shape2strides' ); -var strides2offset = require( '@stdlib/ndarray-base-strides2offset' ); -var ndarray = require( '@stdlib/ndarray-ctor' ); -var every = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof every, 'function', 'main export is a function'); - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, -16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, 16, 16, 8, 4, 2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (row-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'row-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 16, 16, 16, 16, 16, 16, -16, 16, -8, -4, -2, 1 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, singleton dimensions)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, singleton dimensions, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, contiguous)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 1, -1, -4, 8, -8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, contiguous, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( numel( sh ), dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, complex)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'complex128'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, -1, 1, -1, 1, 1, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, zeros( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, ones( 16, dt ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, contiguous, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = shape2strides( sh, ord ); - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( numel( sh ), dt ) ), sh, st, o, ord ); // eslint-disable-line max-len - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, non-contiguous, same sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function tests whether every element in a n-dimensional ndarray is truthy (column-major, non-contiguous, mixed sign strides, accessors)', function test( t ) { - var actual; - var ord; - var sh; - var st; - var dt; - var o; - var x; - - dt = 'float64'; - ord = 'column-major'; - sh = [ 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2 ]; - st = [ 1, 1, 1, 1, -1, 1, -1, 1, 1, -4, -8, 8 ]; - o = strides2offset( sh, st ); - - x = ndarray( dt, toAccessorArray( zeros( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, false, 'returns expected value' ); - - x = ndarray( dt, toAccessorArray( ones( 16, dt ) ), sh, st, o, ord ); - - actual = every( [ x ] ); - t.strictEqual( actual, true, 'returns expected value' ); - - t.end(); -});